Skip to content

Commit 658a03d

Browse files
committed
vendor: Update openshift/api to pick up zz_generated.crd-manifests
Like e9762c6 (vendor: Update openshift/api to pick up zz_generated.crd-manifests, 2024-04-30, #1045), except I pulled release-4.16 branches. 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/[email protected] github.com/openshift/library-go@190fec8c3f09de1290c0dcaa25556b4515d65fc6 # different from e9762c6's @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) $ sed -i 's/\(clusterversion\|clusteroperator\)/\1s/' hack/test-prerequisites.go $ git checkout a90cec9 -- pkg/payload/render.go # Eran Cohen's DevPreviewNoUpgrade exclusion $ git add -A Dockerfile* hack/test-prerequisites.go pkg/dependencymagnet pkg/featuregates 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 fail 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. * And I want [5], but for some reason: $ go get github.com/openshift/[email protected] github.com/openshift/[email protected] was getting me the older v0.0.0-20240517135010-e93e442c2b18. I'm not clear on why. But requesting the library-go commit I wanted by commit-hash instead of by branch-name got me the CustomNoUpgrade fix. * The DevPreviewNoUpgrade exclusion avoids bootstrap failures like [6]: $ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/openshift_cluster-version-operator/1045/pull-ci-openshift-cluster-version-operator-master-e2e-aws-ovn-techpreview/1810753819311607808/artifacts/e2e-aws-ovn-techpreview/ipi-install-install/artifacts/log-bundle-20240709194524.tar | tar -xOz log-bundle-20240709194524/bootstrap/journals/bootkube.log | grep 'are not consistent so results would be unpredictable depending on apply order' | tail -n4 Jul 09 19:45:15 ip-10-0-155-191 kube-apiserver-render[74584]: F0709 19:45:15.447834 1 render.go:75] --rendered-manifest-files, are not consistent so results would be unpredictable depending on apply order: "/assets/manifests/0000_00_cluster-version-operator_01_clusterversions-DevPreviewNoUpgrade.crd.yaml" and "/assets/manifests/0000_00_cluster-version-operator_01_clusterversions-Default.crd.yaml" both set CustomResourceDefinition.apiextensions.k8s.io/clusterversions.config.openshift.io in ns/, but have different values Jul 09 19:45:15 ip-10-0-155-191 bootkube.sh[74561]: F0709 19:45:15.447834 1 render.go:75] --rendered-manifest-files, are not consistent so results would be unpredictable depending on apply order: "/assets/manifests/0000_00_cluster-version-operator_01_cluster versions-DevPreviewNoUpgrade.crd.yaml" and "/assets/manifests/0000_00_cluster-version-operator_01_clusterversions-Default.crd.yaml" both set CustomResourceDefinition.apiextensions.k8s.io/clusterversions.config.openshift.io in ns/, but have different values Jul 09 19:45:27 ip-10-0-155-191 kube-apiserver-render[75368]: F0709 19:45:27.669093 1 render.go:75] --rendered-manifest-files, are not consistent so results would be unpredictable depending on apply order: "/assets/manifests/0000_00_cluster-version-operator_ 01_clusterversions-DevPreviewNoUpgrade.crd.yaml" and "/assets/manifests/0000_00_cluster-version-operator_01_clusterversions-Default.crd.yaml" both set CustomResourceDefinition.apiextensions.k8s.io/clusterversions.config.openshift.io in ns/, but have different values Jul 09 19:45:27 ip-10-0-155-191 bootkube.sh[75345]: F0709 19:45:27.669093 1 render.go:75] --rendered-manifest-files, are not consistent so results would be unpredictable depending on apply order: "/assets/manifests/0000_00_cluster-version-operator_01_cluster versions-DevPreviewNoUpgrade.crd.yaml" and "/assets/manifests/0000_00_cluster-version-operator_01_clusterversions-Default.crd.yaml" both set CustomResourceDefinition.apiextensions.k8s.io/clusterversions.config.openshift.io in ns/, but have different values as the kube-apiserver-render command worries about the CVO having rendered two ClusterVersion CRDs: $ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/openshift_cluster-version-operator/1045/pull-ci-openshift-cluster-version-operator-master-e2e-aws-ovn-techpreview/1810753819311607808/artifacts/e2e-aws-ovn-techpre view/ipi-install-install/artifacts/log-bundle-20240709194524.tar | tar -tvz | grep 'cvo-bootstrap/.*cluster-version-operator.*crd' -rw-r--r-- core/core 42129 2024-07-09 12:45 log-bundle-20240709194524/rendered-assets/openshift/cvo-bootstrap/manifests/0000_00_cluster-version-operator_01_clusterversions-DevPreviewNoUpgrade.crd.yaml -rw-r--r-- core/core 39010 2024-07-09 12:45 log-bundle-20240709194524/rendered-assets/openshift/cvo-bootstrap/manifests/0000_00_cluster-version-operator_01_clusterversions-Default.crd.yaml -rw-r--r-- core/core 7628 2024-07-09 12:45 log-bundle-20240709194524/rendered-assets/openshift/cvo-bootstrap/manifests/0000_00_cluster-version-operator_01_clusteroperators.crd.yaml [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 [5]: openshift/library-go#1759 Backported to 4.16 in openshift/library-go#1762 [6]: 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-e2e-aws-ovn-techpreview/1810753819311607808
1 parent 49b0f18 commit 658a03d

File tree

211 files changed

+10547
-12504
lines changed

Some content is hidden

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

211 files changed

+10547
-12504
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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-20240702171116-4b89b3a92a17
14+
github.com/openshift/client-go v0.0.0-20240405120947-c67c8325cdd8
15+
github.com/openshift/library-go v0.0.0-20240711192904-190fec8c3f09
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

Lines changed: 6 additions & 6 deletions
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-20240702171116-4b89b3a92a17 h1:Hl43oJR6bKPkW8xQty+N+/Ot8ioEyLwNU4CNvxik7iE=
93+
github.com/openshift/api v0.0.0-20240702171116-4b89b3a92a17/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-20240711192904-190fec8c3f09 h1:2Ed1mxJTRFpbHIynxkuIyADeWdtyQ6NEZkTaf0wG39M=
97+
github.com/openshift/library-go v0.0.0-20240711192904-190fec8c3f09/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

Lines changed: 2 additions & 2 deletions
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_clusterversions-Default.crd.yaml",
31+
"vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusteroperators.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

Lines changed: 8 additions & 0 deletions
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/featuregates.go

Lines changed: 3 additions & 2 deletions
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
}

pkg/payload/render.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ func renderDir(renderConfig manifestRenderConfig, idir, odir string, skipFiles s
7676
if skipFiles.Has(file.Name()) {
7777
continue
7878
}
79-
if strings.Contains(file.Name(), "CustomNoUpgrade") || strings.Contains(file.Name(), "TechPreviewNoUpgrade") {
80-
// CustomNoUpgrade and TechPreviewNoUpgrade may add features to manifests like the ClusterVersion CRD,
79+
if strings.Contains(file.Name(), "CustomNoUpgrade") || strings.Contains(file.Name(), "TechPreviewNoUpgrade") || strings.Contains(file.Name(), "DevPreviewNoUpgrade") {
80+
// CustomNoUpgrade, TechPreviewNoUpgrade and DevPreviewNoUpgrade may add features to manifests like the ClusterVersion CRD,
8181
// but we do not need those features during bootstrap-render time. In those clusters, the production
8282
// CVO will be along shortly to update the manifests and deliver the gated features.
8383
continue

0 commit comments

Comments
 (0)