From a90cec99fc8f0e554d16ff866d48e224a7f2efb3 Mon Sep 17 00:00:00 2001 From: Eran Cohen Date: Tue, 25 Jun 2024 14:37:35 +0300 Subject: [PATCH] Catching up with the YAML getting shifted into a subdirectory [1]. I followed the new docs from [2] to create pkg/dependencymagnet Skip render for DevPreviewNoUpgrade The Default ClusterVersion CRD is the one we want to render during bootstrap-render Update ./hack/test-prerequisites.go to pick up clusterversion crds from the new path config/v1/zz_generated.crd-manifests [1]: openshift/api#1814 [2]: openshift/api@06baaa4#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R211 Signed-off-by: Eran Cohen --- hack/test-prerequisites.go | 4 ++-- pkg/dependencymagnet/doc.go | 8 ++++++++ pkg/payload/render.go | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 pkg/dependencymagnet/doc.go diff --git a/hack/test-prerequisites.go b/hack/test-prerequisites.go index 7d0e0783e..a4ee84dd7 100644 --- a/hack/test-prerequisites.go +++ b/hack/test-prerequisites.go @@ -27,8 +27,8 @@ func main() { client := apiext.NewForConfigOrDie(cfg) for _, path := range []string{ - "vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_01_clusterversion-Default.crd.yaml", - "vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_01_clusteroperator.crd.yaml", + "vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-Default.crd.yaml", + "vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusteroperators.crd.yaml", } { var name string err := wait.PollUntilContextTimeout(ctx, time.Second, 30*time.Second, true, func(localCtx context.Context) (bool, error) { diff --git a/pkg/dependencymagnet/doc.go b/pkg/dependencymagnet/doc.go new file mode 100644 index 000000000..d6af161e2 --- /dev/null +++ b/pkg/dependencymagnet/doc.go @@ -0,0 +1,8 @@ +// Package dependencymagnet adds nominal Go dependencies so 'go mod' +// will pull in content we do not actually need to compile our Go, but +// which we do need to build our container image. +package dependencymagnet + +import ( + _ "github.com/openshift/api/config/v1/zz_generated.crd-manifests" +) diff --git a/pkg/payload/render.go b/pkg/payload/render.go index 6a04b12f6..52709a29a 100644 --- a/pkg/payload/render.go +++ b/pkg/payload/render.go @@ -76,8 +76,8 @@ func renderDir(renderConfig manifestRenderConfig, idir, odir string, skipFiles s if skipFiles.Has(file.Name()) { continue } - if strings.Contains(file.Name(), "CustomNoUpgrade") || strings.Contains(file.Name(), "TechPreviewNoUpgrade") { - // CustomNoUpgrade and TechPreviewNoUpgrade may add features to manifests like the ClusterVersion CRD, + if strings.Contains(file.Name(), "CustomNoUpgrade") || strings.Contains(file.Name(), "TechPreviewNoUpgrade") || strings.Contains(file.Name(), "DevPreviewNoUpgrade") { + // CustomNoUpgrade, TechPreviewNoUpgrade and DevPreviewNoUpgrade may add features to manifests like the ClusterVersion CRD, // but we do not need those features during bootstrap-render time. In those clusters, the production // CVO will be along shortly to update the manifests and deliver the gated features. continue