Skip to content

Commit f995620

Browse files
committed
vendor: Update openshift/api to pick up zz_generated.crd-manifests
Catching up with the YAML getting shifted into a subdirectory [1]. I followed the new docs from [2] to create pkg/dependencymagnet, and then: $ emacs pkg/featuregates/featuregates.go pkg/featuregates/featurechangestopper_test.go # configv1.FeatureGateUpgradeStatus -> features.FeatureGateUpgradeStatus $ go get github.com/openshift/api@master github.com/openshift/library-go@master $ go mod tidy $ go mod vendor $ sed -i 's|config/v1/0000_00_cluster-version-operator|config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator|g' $(git grep -l 0000_00_cluster-version-operator) $ git add -A Dockerfile* hack/test-prerequisites.go pkg/dependencymagnet go.* vendor all using: $ go version go version go1.22.2 linux/amd64 A few points on the invocation: * I usually use 'go get -u ...', e.g. a98232f (vendor: Bump openshift/api to pick up signatureStores, 2023-12-04, #994), but in this case, that would pull in k8s.io/[email protected], and we want to stick with 0.29 until our release-4.16 branch stops following this development branch. * I'm explicitly bumping library-go, because if I don't, builds on [3]: Building github.com/openshift/cluster-version-operator (v1.0.0-1203-g258de3f7-dirty) # github.com/openshift/library-go/pkg/manifest vendor/github.com/openshift/library-go/pkg/manifest/manifest.go:32:35: undefined: configv1.FeatureSets # github.com/openshift/cluster-version-operator/pkg/featuregates pkg/featuregates/featuregates.go:92:32: undefined: configv1.FeatureGateUpgradeStatus pkg/featuregates/featuregates.go:97:33: undefined: configv1.FeatureGateUpgradeStatus If I had been able to use -u, library-go would have automatically floated to the tip commit anyway. But either way, I still needed to make manual changes to keep up with [4] moving to the new openshift/api/features package. [1]: openshift/api#1814 [2]: openshift/api@06baaa4#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R211 [3]: https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift_cluster-version-operator/1045/pull-ci-openshift-cluster-version-operator-master-images/1785396933666279424#1:build-log.txt%3A74-79 [4]: openshift/api#1821
1 parent 0b3f507 commit f995620

File tree

212 files changed

+11020
-11937
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+11020
-11937
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ RUN hack/build-go.sh; \
88
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
99
COPY --from=builder /tmp/build/cluster-version-operator /usr/bin/
1010
COPY install /manifests
11-
COPY vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_* /manifests/
11+
COPY vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_* /manifests/
1212
COPY bootstrap /bootstrap
1313
ENTRYPOINT ["/usr/bin/cluster-version-operator"]

Dockerfile.rhel

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ RUN hack/build-go.sh; \
88
FROM registry.ci.openshift.org/ocp/4.16:base-rhel9
99
COPY --from=builder /tmp/build/cluster-version-operator /usr/bin/
1010
COPY install /manifests
11-
COPY vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_* /manifests/
11+
COPY vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_* /manifests/
1212
COPY bootstrap /bootstrap
1313
ENTRYPOINT ["/usr/bin/cluster-version-operator"]

go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ require (
1010
github.com/ghodss/yaml v1.0.0
1111
github.com/google/go-cmp v0.6.0
1212
github.com/google/uuid v1.3.0
13-
github.com/openshift/api v0.0.0-20240301093301-ce10821dc999
14-
github.com/openshift/client-go v0.0.0-20230926161409-848405da69e1
15-
github.com/openshift/library-go v0.0.0-20231017173800-126f85ed0cc7
13+
github.com/openshift/api v0.0.0-20240429104249-ac9356ba1784
14+
github.com/openshift/client-go v0.0.0-20240405120947-c67c8325cdd8
15+
github.com/openshift/library-go v0.0.0-20240426153406-52527b886e57
1616
github.com/operator-framework/api v0.17.1
1717
github.com/operator-framework/operator-lifecycle-manager v0.22.0
1818
github.com/pkg/errors v0.9.1

go.sum

+6-6
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4
8989
github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
9090
github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
9191
github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
92-
github.com/openshift/api v0.0.0-20240301093301-ce10821dc999 h1:+S998xHiJApsJZjRAO8wyedU9GfqFd8mtwWly6LqHDo=
93-
github.com/openshift/api v0.0.0-20240301093301-ce10821dc999/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
94-
github.com/openshift/client-go v0.0.0-20230926161409-848405da69e1 h1:W1N/3nVciqmjPjn2xldHjb0AwwCQzlGxLvX5BCgE8H4=
95-
github.com/openshift/client-go v0.0.0-20230926161409-848405da69e1/go.mod h1:ihUJrhBcYAGYQrJu/gP2OMgfVds5f5z5kbeLNBqjHLo=
96-
github.com/openshift/library-go v0.0.0-20231017173800-126f85ed0cc7 h1:pJLcCSJzdiWCaJ4bAepgnvwMdP33LumbVJyWSW7+3ng=
97-
github.com/openshift/library-go v0.0.0-20231017173800-126f85ed0cc7/go.mod h1:jgxNp8aApJnZtECid9SUSr5Bu6DLo8Hfdv1DgFZaYA8=
92+
github.com/openshift/api v0.0.0-20240429104249-ac9356ba1784 h1:SmOZFMxuAH4d1Cj7dOftVyo4Wg/mEC4pwz6QIJJsAkc=
93+
github.com/openshift/api v0.0.0-20240429104249-ac9356ba1784/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
94+
github.com/openshift/client-go v0.0.0-20240405120947-c67c8325cdd8 h1:HGfbllzRcrJBSiwzNjBCs7sExLUxC5/1evnvlNGB0Cg=
95+
github.com/openshift/client-go v0.0.0-20240405120947-c67c8325cdd8/go.mod h1:+VvvaMSTUhOt+rBq7NwRLSNxq06hTeRCBqm0j0PQEq8=
96+
github.com/openshift/library-go v0.0.0-20240426153406-52527b886e57 h1:A5yWMIoZBJa4PjODuLUp3TqYUxgg+rMZCRd9TwSHh9Y=
97+
github.com/openshift/library-go v0.0.0-20240426153406-52527b886e57/go.mod h1:lFwyRj0XjUf25Da3Q00y+KuaxCWTJ6YzYPDX1+96nco=
9898
github.com/operator-framework/api v0.17.1 h1:J/6+Xj4IEV8C7hcirqUFwOiZAU3PbnJhWvB0/bB51c4=
9999
github.com/operator-framework/api v0.17.1/go.mod h1:kk8xJahHJR3bKqrA+A+1VIrhOTmyV76k+ARv+iV+u1Q=
100100
github.com/operator-framework/operator-lifecycle-manager v0.22.0 h1:7DEWOq24HQ0l5xPOXMhn17XaJACgwoipz+JfQ7QCXZw=

hack/test-prerequisites.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ func main() {
2727

2828
client := apiext.NewForConfigOrDie(cfg)
2929
for _, path := range []string{
30-
"vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_01_clusterversion-Default.crd.yaml",
31-
"vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_01_clusteroperator.crd.yaml",
30+
"vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversion-Default.crd.yaml",
31+
"vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusteroperator.crd.yaml",
3232
} {
3333
var name string
3434
err := wait.PollUntilContextTimeout(ctx, time.Second, 30*time.Second, true, func(localCtx context.Context) (bool, error) {

pkg/dependencymagnet/doc.go

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Package dependencymagnet adds nominal Go dependencies so 'go mod'
2+
// will pull in content we do not actually need to compile our Go, but
3+
// which we do need to build our container image.
4+
package dependencymagnet
5+
6+
import (
7+
_ "github.com/openshift/api/config/v1/zz_generated.crd-manifests"
8+
)

pkg/featuregates/featurechangestopper_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"time"
77

88
configv1 "github.com/openshift/api/config/v1"
9+
"github.com/openshift/api/features"
910
fakeconfigv1client "github.com/openshift/client-go/config/clientset/versioned/fake"
1011
configv1informer "github.com/openshift/client-go/config/informers/externalversions"
1112
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -65,7 +66,7 @@ func TestTechPreviewChangeStopper(t *testing.T) {
6566
FeatureGates: []configv1.FeatureGateDetails{
6667
{
6768
Version: versionForGates,
68-
Enabled: []configv1.FeatureGateAttributes{{Name: configv1.FeatureGateUpgradeStatus}},
69+
Enabled: []configv1.FeatureGateAttributes{{Name: features.FeatureGateUpgradeStatus}},
6970
},
7071
},
7172
},

pkg/featuregates/featuregates.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package featuregates
22

33
import (
44
configv1 "github.com/openshift/api/config/v1"
5+
"github.com/openshift/api/features"
56
)
67

78
// CvoGateChecker allows CVO code to check which feature gates are enabled
@@ -89,12 +90,12 @@ func CvoGatesFromFeatureGate(gate *configv1.FeatureGate, version string) CvoGate
8990
// We found the matching version, so we do not need to run in the unknown version mode
9091
enabledGates.unknownVersion = false
9192
for _, enabled := range g.Enabled {
92-
if enabled.Name == configv1.FeatureGateUpgradeStatus {
93+
if enabled.Name == features.FeatureGateUpgradeStatus {
9394
enabledGates.reconciliationIssuesCondition = true
9495
}
9596
}
9697
for _, disabled := range g.Disabled {
97-
if disabled.Name == configv1.FeatureGateUpgradeStatus {
98+
if disabled.Name == features.FeatureGateUpgradeStatus {
9899
enabledGates.reconciliationIssuesCondition = false
99100
}
100101
}

0 commit comments

Comments
 (0)