From cf8b637b4440aaca56d47a8157514c55173dfd05 Mon Sep 17 00:00:00 2001 From: Misha Sugakov Date: Thu, 14 Nov 2024 19:34:19 +0100 Subject: [PATCH 1/5] Remove operator channel label from the GHA-built bundle dockerfile --- operator/Makefile | 4 ++++ operator/bundle.Dockerfile | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/operator/Makefile b/operator/Makefile index eae136937425d..fa5566829f3e2 100644 --- a/operator/Makefile +++ b/operator/Makefile @@ -416,6 +416,10 @@ bundle: yq manifests kustomize operator-sdk ## Generate bundle manifests and met $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) # Fix the createdAt annotation $(YQ) -i '.metadata.annotations.createdAt = ""' bundle/manifests/rhacs-operator.clusterserviceversion.yaml +# Remove autogenerated operator channel LABEL from the bundle to avoid confusion because it's ignored anyways. +# There's still channels annotation in bundle/metadata/annotations.yaml and it cannot be removed because the +# `bundle validate` command below would fail (despite the annotation still being igored by the index builds). + sed -i'.bak' -e '/operators\.operatorframework\.io\.bundle\.channel/d' bundle.Dockerfile # Delete lines that copy the original bundle files in bundle.Dockerfile (we can't just use `rm` in scratch image). # Post-processed files will be copied instead, as configured in bundle.Dockerfile.extra. sed -i'.bak' -e '/# Copy files to locations specified by labels./d' bundle.Dockerfile diff --git a/operator/bundle.Dockerfile b/operator/bundle.Dockerfile index 910794a6e73a6..4c8f6090339e8 100644 --- a/operator/bundle.Dockerfile +++ b/operator/bundle.Dockerfile @@ -5,7 +5,6 @@ LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ LABEL operators.operatorframework.io.bundle.package.v1=rhacs-operator -LABEL operators.operatorframework.io.bundle.channels.v1=alpha LABEL operators.operatorframework.io.metrics.builder=operator-sdk-unknown LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4 From 084085fa4ee7021eca7e2d5cc5505e0d82d59344 Mon Sep 17 00:00:00 2001 From: Misha Sugakov Date: Thu, 14 Nov 2024 19:34:46 +0100 Subject: [PATCH 2/5] Remove channel labels from Konflux bundle dockerfile --- operator/konflux.bundle.Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/operator/konflux.bundle.Dockerfile b/operator/konflux.bundle.Dockerfile index 917ec39624a73..ff9ffc23ae965 100644 --- a/operator/konflux.bundle.Dockerfile +++ b/operator/konflux.bundle.Dockerfile @@ -105,8 +105,6 @@ LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ LABEL operators.operatorframework.io.bundle.package.v1=rhacs-operator -LABEL operators.operatorframework.io.bundle.channels.v1=fast -LABEL operators.operatorframework.io.bundle.channel.default.v1=fast LABEL operators.operatorframework.io.metrics.builder=operator-sdk-unknown LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 From c2461dcd758a1874279181ac8e3b0adc688cea03 Mon Sep 17 00:00:00 2001 From: Misha Sugakov Date: Thu, 14 Nov 2024 19:36:11 +0100 Subject: [PATCH 3/5] Update first version for Konflux builds Its value does not play any role after we actually published 4.0.0 and 4.1.0 (which was long ago) but it is appealing to keep the values right. First version 4.0.0 signifies that our upgrade graph was broken on it. --- operator/konflux.bundle.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operator/konflux.bundle.Dockerfile b/operator/konflux.bundle.Dockerfile index ff9ffc23ae965..58e87bff7d6ff 100644 --- a/operator/konflux.bundle.Dockerfile +++ b/operator/konflux.bundle.Dockerfile @@ -66,7 +66,7 @@ RUN mkdir -p build/ && \ cp -v ../config-controller/config/crd/bases/config.stackrox.io_securitypolicies.yaml build/bundle/manifests/ && \ ./bundle_helpers/patch-csv.py \ --use-version "${OPERATOR_IMAGE_TAG}" \ - --first-version 3.62.0 \ + --first-version 4.0.0 \ --related-images-mode=konflux \ --operator-image "${OPERATOR_IMAGE_REF}" \ --add-supported-arch amd64 \ From 1a8bff0144b70ad6e4f45922140933e0c8787a8c Mon Sep 17 00:00:00 2001 From: Misha Sugakov Date: Fri, 15 Nov 2024 18:33:50 +0100 Subject: [PATCH 4/5] Eliminate misleading channel from annotations.yaml Because I want it gone. --- operator/Makefile | 8 +++++--- operator/bundle/metadata/annotations.yaml | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/operator/Makefile b/operator/Makefile index fa5566829f3e2..f541474137774 100644 --- a/operator/Makefile +++ b/operator/Makefile @@ -416,9 +416,7 @@ bundle: yq manifests kustomize operator-sdk ## Generate bundle manifests and met $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) # Fix the createdAt annotation $(YQ) -i '.metadata.annotations.createdAt = ""' bundle/manifests/rhacs-operator.clusterserviceversion.yaml -# Remove autogenerated operator channel LABEL from the bundle to avoid confusion because it's ignored anyways. -# There's still channels annotation in bundle/metadata/annotations.yaml and it cannot be removed because the -# `bundle validate` command below would fail (despite the annotation still being igored by the index builds). +# Remove autogenerated operator channel LABEL from the bundle image to avoid confusion because it's ignored anyways. sed -i'.bak' -e '/operators\.operatorframework\.io\.bundle\.channel/d' bundle.Dockerfile # Delete lines that copy the original bundle files in bundle.Dockerfile (we can't just use `rm` in scratch image). # Post-processed files will be copied instead, as configured in bundle.Dockerfile.extra. @@ -471,6 +469,10 @@ bundle-post-process: test-bundle-helpers operator-sdk ## Post-process CSV file t > build/bundle/manifests/rhacs-operator.clusterserviceversion.yaml # Check that the resulting bundle still passes validations. $(OPERATOR_SDK) bundle validate ./build/bundle --select-optional suite=operatorframework +# Remove autogenerated channels annotation from bundle/metadata/annotations.yaml because it's ignored. This has to be +# done after operator-sdk bundle validate command because otherwise it fails with an error. + sed -i'.bak' -e '/operators\.operatorframework\.io\.bundle\.channel/d' bundle/metadata/annotations.yaml + rm -f bundle/metadata/annotations.yaml.bak .PHONY: bundle-build bundle-build: bundle.Dockerfile bundle-post-process ## Build the bundle image. diff --git a/operator/bundle/metadata/annotations.yaml b/operator/bundle/metadata/annotations.yaml index 915fbc1f951d9..6e06a9431c577 100644 --- a/operator/bundle/metadata/annotations.yaml +++ b/operator/bundle/metadata/annotations.yaml @@ -4,7 +4,6 @@ annotations: operators.operatorframework.io.bundle.manifests.v1: manifests/ operators.operatorframework.io.bundle.metadata.v1: metadata/ operators.operatorframework.io.bundle.package.v1: rhacs-operator - operators.operatorframework.io.bundle.channels.v1: alpha operators.operatorframework.io.metrics.builder: operator-sdk-unknown operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v4 From f6b8943a8fe39a645952823cfc2dbec2d9eb28be Mon Sep 17 00:00:00 2001 From: Misha Sugakov Date: Fri, 15 Nov 2024 20:14:48 +0100 Subject: [PATCH 5/5] Revert "Eliminate misleading channel from annotations.yaml" This reverts commit 1a8bff0144b70ad6e4f45922140933e0c8787a8c. Because there are more operator-sdk bundle validate calls down the line. --- operator/Makefile | 8 +++----- operator/bundle/metadata/annotations.yaml | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/operator/Makefile b/operator/Makefile index f541474137774..fa5566829f3e2 100644 --- a/operator/Makefile +++ b/operator/Makefile @@ -416,7 +416,9 @@ bundle: yq manifests kustomize operator-sdk ## Generate bundle manifests and met $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) # Fix the createdAt annotation $(YQ) -i '.metadata.annotations.createdAt = ""' bundle/manifests/rhacs-operator.clusterserviceversion.yaml -# Remove autogenerated operator channel LABEL from the bundle image to avoid confusion because it's ignored anyways. +# Remove autogenerated operator channel LABEL from the bundle to avoid confusion because it's ignored anyways. +# There's still channels annotation in bundle/metadata/annotations.yaml and it cannot be removed because the +# `bundle validate` command below would fail (despite the annotation still being igored by the index builds). sed -i'.bak' -e '/operators\.operatorframework\.io\.bundle\.channel/d' bundle.Dockerfile # Delete lines that copy the original bundle files in bundle.Dockerfile (we can't just use `rm` in scratch image). # Post-processed files will be copied instead, as configured in bundle.Dockerfile.extra. @@ -469,10 +471,6 @@ bundle-post-process: test-bundle-helpers operator-sdk ## Post-process CSV file t > build/bundle/manifests/rhacs-operator.clusterserviceversion.yaml # Check that the resulting bundle still passes validations. $(OPERATOR_SDK) bundle validate ./build/bundle --select-optional suite=operatorframework -# Remove autogenerated channels annotation from bundle/metadata/annotations.yaml because it's ignored. This has to be -# done after operator-sdk bundle validate command because otherwise it fails with an error. - sed -i'.bak' -e '/operators\.operatorframework\.io\.bundle\.channel/d' bundle/metadata/annotations.yaml - rm -f bundle/metadata/annotations.yaml.bak .PHONY: bundle-build bundle-build: bundle.Dockerfile bundle-post-process ## Build the bundle image. diff --git a/operator/bundle/metadata/annotations.yaml b/operator/bundle/metadata/annotations.yaml index 6e06a9431c577..915fbc1f951d9 100644 --- a/operator/bundle/metadata/annotations.yaml +++ b/operator/bundle/metadata/annotations.yaml @@ -4,6 +4,7 @@ annotations: operators.operatorframework.io.bundle.manifests.v1: manifests/ operators.operatorframework.io.bundle.metadata.v1: metadata/ operators.operatorframework.io.bundle.package.v1: rhacs-operator + operators.operatorframework.io.bundle.channels.v1: alpha operators.operatorframework.io.metrics.builder: operator-sdk-unknown operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v4