Skip to content

Commit fad3bee

Browse files
chore: unpin github.com/openshift/api (#1090)
This commit unpins the version of `github.com/openshift/api` to depend on the latest version. To continue supporting older OpenShift versions which require the Console v1alpha1 API (removed since 2024), we fork the `github.com/openshift/api` under `github.com/rhobs/openshift-api` and pinned to the same version that was used before this change. Signed-off-by: Simon Pasquier <spasquie@redhat.com>
1 parent 5ec787a commit fad3bee

12 files changed

Lines changed: 46 additions & 72 deletions

DEPENDENCY_CONSTRAINTS.md

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Dependency Constraints
22

3-
This document describes the constraints and pinned dependencies in this project.
3+
This document describes how we manage dependencies for this project.
44

5-
## Pinned Dependencies
5+
## Forked OpenShift API (`github.com/openshift/api`)
66

7-
### OpenShift API (`github.com/openshift/api`)
7+
This project depends on 2 versions of `github.com/openshift/api`:
8+
* The [canonical version](https://github.com/openshift/api).
9+
* A [forked version](https://github.com/rhobs/openshift-api).
810

9-
**Current Version:** `v0.0.0-20240404200104-96ed2d49b255`
10-
11-
**Why Pinned:** The observability-operator needs to support both OpenShift console API `v1` and `v1alpha1` for backward compatibility:
12-
- OpenShift >= 4.17 uses `console/v1` API
11+
**Why Forked:** The observability-operator needs to support both OpenShift console API `v1` and `v1alpha1` for backward compatibility:
12+
- OpenShift >= 4.17 uses `console/v1` API
1313
- OpenShift < 4.17 uses `console/v1alpha1` API
1414

15-
Newer versions of `github.com/openshift/api` (after April 2024) have removed the `console/v1alpha1` API, breaking compatibility with older OpenShift versions.
15+
Newer versions of `github.com/openshift/api` (after April 2024) have removed the `console/v1alpha1` API, breaking compatibility with older OpenShift versions. To continue supporting older versions, we forked the library under (https://github.com/rhobs/openshift-api) using the last commit including the `v1alpha1` API and renaming the Go module in `go.mod` to `github.com/rhobs/openshift-api`.
1616

1717
**Impact:** The codebase maintains dual API support with runtime version detection to create the appropriate Console Plugin resources.
1818

@@ -23,37 +23,14 @@ Newer versions of `github.com/openshift/api` (after April 2024) have removed the
2323
- `pkg/operator/scheme.go` - API scheme registration
2424
- All uiplugin package files using `osv1alpha1` imports
2525

26-
## Safe to Update Dependencies
27-
28-
The following dependencies can be safely updated:
29-
- Kubernetes API packages (`k8s.io/*`)
30-
- Controller Runtime (`sigs.k8s.io/controller-runtime`)
31-
- Prometheus packages (`github.com/prometheus/*`)
32-
- RHOBS Prometheus Operator (`github.com/rhobs/obo-prometheus-operator`)
33-
- Go standard library extensions (`golang.org/x/*`)
34-
- Utility libraries (`github.com/go-logr/logr`, `github.com/google/go-cmp`, etc.)
35-
3626
## Updating Dependencies
3727

38-
To update dependencies safely:
39-
40-
1. **Individual updates:** Update specific packages excluding openshift/api:
41-
```bash
42-
go get -u k8s.io/api k8s.io/apimachinery k8s.io/client-go
43-
go get -u sigs.k8s.io/controller-runtime
44-
go get -u github.com/rhobs/obo-prometheus-operator@v0.83.0-rhobs1
45-
```
46-
47-
2. **Avoid bulk updates:** Don't use `go get -u ./...` as it will try to update openshift/api
48-
49-
3. **Always test:** Run `make test-unit` and `make build` after each update
50-
51-
4. **Fix go.sum:** Run `go mod tidy` after updates to fix missing entries
28+
Dependabot takes care of dependency updates, the configuration is located at `.github/dependabot.yml`.
5229

5330
## Future Considerations
5431

55-
When OpenShift < 4.17 support is no longer needed:
56-
1. Remove `console/v1alpha1` API usage
57-
2. Unpin `github.com/openshift/api`
58-
3. Remove dual API support code
59-
4. Update this document
32+
When OpenShift &lt; 4.17 support is no longer needed, we can:
33+
1. Remove `console/v1alpha1` API usage.
34+
2. Remove dual API support code.
35+
3. Remove dependency on `github.com/rhobs/openshift-api`
36+
4. Update this document

go.mod

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,24 @@ require (
99
github.com/google/go-cmp v0.7.0
1010
github.com/grafana/tempo-operator v0.20.0
1111
github.com/open-telemetry/opentelemetry-operator v0.148.0
12-
github.com/openshift/api v3.9.0+incompatible // PINNED: newer versions remove console/v1alpha1 API needed for OpenShift <4.17 compatibility
12+
github.com/openshift/api v0.0.0-20260511191110-9b69e5fa27e9
1313
github.com/openshift/controller-runtime-common v0.0.0-20260318085703-1812aed6dbd2
14-
github.com/openshift/library-go v0.0.0-20260213153706-03f1709971c5
14+
github.com/openshift/library-go v0.0.0-20260512121938-431f18311e77
1515
github.com/operator-framework/api v0.42.0
16+
github.com/perses/perses v0.53.1
17+
github.com/perses/plugins/prometheus v0.57.0
18+
github.com/perses/plugins/table v0.11.2
19+
github.com/perses/plugins/timeserieschart v0.12.1
20+
github.com/perses/spec v0.1.2
1621
github.com/pkg/errors v0.9.1
1722
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.90.1
1823
github.com/prometheus/common v0.67.5
1924
github.com/rhobs/obo-prometheus-operator v0.90.1-rhobs1
2025
github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring v0.90.1-rhobs1
2126
github.com/rhobs/observability-operator/pkg/apis v0.0.0-20251009091129-76135c924ed6
27+
github.com/rhobs/openshift-api v0.0.0-20260512142436-2e89e902a420
28+
github.com/rhobs/perses v0.0.0-20260422074433-2c06d5cd1312
29+
github.com/rhobs/perses-operator v0.1.10-0.20260422102948-9bec730aa616
2230
github.com/stretchr/testify v1.11.1
2331
go.uber.org/zap v1.27.1
2432
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90
@@ -35,22 +43,6 @@ require (
3543
sigs.k8s.io/controller-runtime v0.23.3
3644
)
3745

38-
replace (
39-
github.com/openshift/api => github.com/openshift/api v0.0.0-20240404200104-96ed2d49b255
40-
github.com/openshift/controller-runtime-common => github.com/openshift/controller-runtime-common v0.0.0-20260210092218-8eef974290cd
41-
github.com/rhobs/observability-operator/pkg/apis => ./pkg/apis
42-
)
43-
44-
require (
45-
github.com/perses/perses v0.53.1
46-
github.com/perses/plugins/prometheus v0.57.0
47-
github.com/perses/plugins/table v0.11.2
48-
github.com/perses/plugins/timeserieschart v0.12.1
49-
github.com/perses/spec v0.1.2
50-
github.com/rhobs/perses v0.0.0-20260422074433-2c06d5cd1312
51-
github.com/rhobs/perses-operator v0.1.10-0.20260422102948-9bec730aa616
52-
)
53-
5446
require (
5547
cel.dev/expr v0.25.1 // indirect
5648
dario.cat/mergo v1.0.2 // indirect
@@ -194,3 +186,5 @@ require (
194186
sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect
195187
sigs.k8s.io/yaml v1.6.0 // indirect
196188
)
189+
190+
replace github.com/rhobs/observability-operator/pkg/apis => ./pkg/apis

go.sum

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,12 @@ github.com/open-telemetry/opentelemetry-operator v0.148.0 h1:kzVgjGDejYi/tS6U9Pn
290290
github.com/open-telemetry/opentelemetry-operator v0.148.0/go.mod h1:FyHoJIYYJj9aSkwdUjpJekEhqtTsBz/LgjxiRp94k5k=
291291
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
292292
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
293-
github.com/openshift/api v0.0.0-20240404200104-96ed2d49b255 h1:OPEl/rl/Bt8soLkMUex9PZu9PJB59VPFnaPh/n1Pb3I=
294-
github.com/openshift/api v0.0.0-20240404200104-96ed2d49b255/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
295-
github.com/openshift/controller-runtime-common v0.0.0-20260210092218-8eef974290cd h1:pwYZz6/NjHBCrxp/oalDmVl2KP/10Pimzr+BhfKCF9Q=
296-
github.com/openshift/controller-runtime-common v0.0.0-20260210092218-8eef974290cd/go.mod h1:v50YKO19Utu2nn7jsWwMFZXmO+HSHdkeDdEdNvOSy88=
297-
github.com/openshift/library-go v0.0.0-20260213153706-03f1709971c5 h1:9Pe6iVOMjt9CdA/vaKBNUSoEIjIe1po5Ha3ABRYXLJI=
298-
github.com/openshift/library-go v0.0.0-20260213153706-03f1709971c5/go.mod h1:K3FoNLgNBFYbFuG+Kr8usAnQxj1w84XogyUp2M8rK8k=
293+
github.com/openshift/api v0.0.0-20260511191110-9b69e5fa27e9 h1:yb8ul1HPFYhO04yp0D8T/qSySZnKv210f4nE//i/Bdg=
294+
github.com/openshift/api v0.0.0-20260511191110-9b69e5fa27e9/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo=
295+
github.com/openshift/controller-runtime-common v0.0.0-20260318085703-1812aed6dbd2 h1:GrZlVichOCE/lz8fg1+eNrAtkM0VSlqa9buuzN0vnb0=
296+
github.com/openshift/controller-runtime-common v0.0.0-20260318085703-1812aed6dbd2/go.mod h1:XGabTMnNbz0M5Oa7IbscZp/jmcc7aHobvOCUWwkzKvM=
297+
github.com/openshift/library-go v0.0.0-20260512121938-431f18311e77 h1:aj6OEadsB7mJkUoukka+7y0x0Q3o7n/BIAmkPFB4160=
298+
github.com/openshift/library-go v0.0.0-20260512121938-431f18311e77/go.mod h1:gKG9lctU0yEftSoT3DUyeIWz1oAgF0EHUpwI4pnCo4o=
299299
github.com/operator-framework/api v0.42.0 h1:rkc5V3zW8RxZMjePAe12jdL7Co/hwsYo1pLnkkhuR7s=
300300
github.com/operator-framework/api v0.42.0/go.mod h1:bMEj+wl/8tGqcGNtxt38cLUYagu9chNsbYzb/5HQaUQ=
301301
github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o=
@@ -359,6 +359,8 @@ github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring v0.90.1-rhobs1 h1:y
359359
github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring v0.90.1-rhobs1/go.mod h1:smEIMH0TANmMFkksWwrwxSP/pNdjVa66WNO06Nf7ylc=
360360
github.com/rhobs/obo-prometheus-operator/pkg/client v0.90.1-rhobs1 h1:Ut5Cirj3CBXMNy0UQnce8XwDEH/Nwv7dgEs1rUyhUrk=
361361
github.com/rhobs/obo-prometheus-operator/pkg/client v0.90.1-rhobs1/go.mod h1:gy2Ky11XeW8qbt7iyeOd7lhQa9wk+aIQfARs1tAffw4=
362+
github.com/rhobs/openshift-api v0.0.0-20260512142436-2e89e902a420 h1:7e9fFgSnTQH6mOUK9ne8eueLoDe0qFdxPZn0yYD3T4Y=
363+
github.com/rhobs/openshift-api v0.0.0-20260512142436-2e89e902a420/go.mod h1:W0V3SoeXIKmaTN3pqMKDiLZ23rc9viuqYenk9+89N+o=
362364
github.com/rhobs/perses v0.0.0-20260422074433-2c06d5cd1312 h1:FIHpZaFw4s8KwL1MbBbehbhnaIoWqK9w6BQHp8qtk50=
363365
github.com/rhobs/perses v0.0.0-20260422074433-2c06d5cd1312/go.mod h1:1eTdHfUEzWvkpxzblN5MeXnvcTLoMFSXcAl1rbdEkJo=
364366
github.com/rhobs/perses-operator v0.1.10-0.20260422102948-9bec730aa616 h1:pBAB0AH1JT21OkD8wpoxeTuPot9mWQWo2KYRKaCzPMo=

pkg/controllers/uiplugin/components.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
"github.com/go-logr/logr"
1414
osv1 "github.com/openshift/api/console/v1"
15-
osv1alpha1 "github.com/openshift/api/console/v1alpha1"
15+
osv1alpha1 "github.com/rhobs/openshift-api/console/v1alpha1"
1616
"golang.org/x/mod/semver"
1717
appsv1 "k8s.io/api/apps/v1"
1818
corev1 "k8s.io/api/core/v1"
@@ -265,8 +265,9 @@ func newConsolePlugin(info UIPluginInfo, namespace string) *osv1.ConsolePlugin {
265265
BasePath: "/",
266266
},
267267
},
268-
Proxy: info.Proxies,
269-
I18n: osv1.ConsolePluginI18n{LoadType: osv1.Preload},
268+
Proxy: info.Proxies,
269+
I18n: osv1.ConsolePluginI18n{LoadType: osv1.Preload},
270+
ContentSecurityPolicy: []osv1.ConsolePluginCSP{},
270271
},
271272
}
272273
}

pkg/controllers/uiplugin/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"github.com/go-logr/logr"
99
configv1 "github.com/openshift/api/config/v1"
1010
osv1 "github.com/openshift/api/console/v1"
11-
osv1alpha1 "github.com/openshift/api/console/v1alpha1"
1211
operatorv1 "github.com/openshift/api/operator/v1"
12+
osv1alpha1 "github.com/rhobs/openshift-api/console/v1alpha1"
1313
persesv1alpha2 "github.com/rhobs/perses-operator/api/v1alpha2"
1414
appsv1 "k8s.io/api/apps/v1"
1515
v1 "k8s.io/api/core/v1"

pkg/controllers/uiplugin/dashboards.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package uiplugin
22

33
import (
44
osv1 "github.com/openshift/api/console/v1"
5-
osv1alpha1 "github.com/openshift/api/console/v1alpha1"
5+
osv1alpha1 "github.com/rhobs/openshift-api/console/v1alpha1"
66
corev1 "k8s.io/api/core/v1"
77
rbacv1 "k8s.io/api/rbac/v1"
88
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

pkg/controllers/uiplugin/distributed_tracing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"strings"
77

88
osv1 "github.com/openshift/api/console/v1"
9-
osv1alpha1 "github.com/openshift/api/console/v1alpha1"
9+
osv1alpha1 "github.com/rhobs/openshift-api/console/v1alpha1"
1010
"gopkg.in/yaml.v3"
1111
corev1 "k8s.io/api/core/v1"
1212
rbacv1 "k8s.io/api/rbac/v1"

pkg/controllers/uiplugin/logging.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
"github.com/go-logr/logr"
1212
osv1 "github.com/openshift/api/console/v1"
13-
osv1alpha1 "github.com/openshift/api/console/v1alpha1"
13+
osv1alpha1 "github.com/rhobs/openshift-api/console/v1alpha1"
1414
"gopkg.in/yaml.v3"
1515
corev1 "k8s.io/api/core/v1"
1616
rbacv1 "k8s.io/api/rbac/v1"

pkg/controllers/uiplugin/monitoring.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"strings"
66

77
osv1 "github.com/openshift/api/console/v1"
8-
osv1alpha1 "github.com/openshift/api/console/v1alpha1"
8+
osv1alpha1 "github.com/rhobs/openshift-api/console/v1alpha1"
99
persesv1alpha2 "github.com/rhobs/perses-operator/api/v1alpha2"
1010
persesconfig "github.com/rhobs/perses/pkg/model/api/config"
1111
"golang.org/x/mod/semver"

pkg/controllers/uiplugin/plugin_info_builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66

77
"github.com/go-logr/logr"
88
osv1 "github.com/openshift/api/console/v1"
9-
osv1alpha1 "github.com/openshift/api/console/v1alpha1"
109
libgocrypto "github.com/openshift/library-go/pkg/crypto"
10+
osv1alpha1 "github.com/rhobs/openshift-api/console/v1alpha1"
1111
corev1 "k8s.io/api/core/v1"
1212
rbacv1 "k8s.io/api/rbac/v1"
1313
"k8s.io/client-go/dynamic"

0 commit comments

Comments
 (0)