From 6dc8d9a11b072cd6916071898463a82784546aa4 Mon Sep 17 00:00:00 2001 From: Eguzki Astiz Lezaun Date: Thu, 3 Oct 2024 15:50:42 +0200 Subject: [PATCH] bundle includes openshift custom annotation (#901) Signed-off-by: Eguzki Astiz Lezaun --- Makefile | 18 +++++++++++++++--- ...uadrant-operator.clusterserviceversion.yaml | 2 +- bundle/metadata/annotations.yaml | 3 ++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 36dd55499..f7422d169 100644 --- a/Makefile +++ b/Makefile @@ -396,14 +396,26 @@ bundle: $(OPM) $(YQ) manifests dependencies-manifests kustomize operator-sdk ## $(call update-csv-config,$(IMG),config/manifests/bases/kuadrant-operator.clusterserviceversion.yaml,.metadata.annotations.containerImage) # Generate bundle $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle -q --overwrite --version $(BUNDLE_VERSION) $(BUNDLE_METADATA_OPTS) + $(MAKE) bundle-post-generate LIMITADOR_OPERATOR_BUNDLE_IMG=$(LIMITADOR_OPERATOR_BUNDLE_IMG) \ + AUTHORINO_OPERATOR_BUNDLE_IMG=$(AUTHORINO_OPERATOR_BUNDLE_IMG) \ + DNS_OPERATOR_BUNDLE_IMG=$(DNS_OPERATOR_BUNDLE_IMG) + $(OPERATOR_SDK) bundle validate ./bundle + $(MAKE) bundle-ignore-createdAt + echo "$$QUAY_EXPIRY_TIME_LABEL" >> bundle.Dockerfile + +.PHONY: bundle-post-generate +bundle-post-generate: OPENSHIFT_VERSIONS_ANNOTATION_KEY="com.redhat.openshift.versions" +# Supports Openshift v4.12+ (https://redhat-connect.gitbook.io/certified-operator-guide/ocp-deployment/operator-metadata/bundle-directory/managing-openshift-versions) +bundle-post-generate: OPENSHIFT_SUPPORTED_VERSIONS="v4.12" +bundle-post-generate: + # Set Openshift version in bundle annotations + $(YQ) -i '.annotations[$(OPENSHIFT_VERSIONS_ANNOTATION_KEY)] = $(OPENSHIFT_SUPPORTED_VERSIONS)' bundle/metadata/annotations.yaml + $(YQ) -i '(.annotations[$(OPENSHIFT_VERSIONS_ANNOTATION_KEY)] | key) headComment = "Custom annotations"' bundle/metadata/annotations.yaml # Update operator dependencies # TODO(eguzki): run only if not default one. Avoid bundle parsing if version is known in advance $(call update-operator-dependencies,limitador-operator,$(LIMITADOR_OPERATOR_BUNDLE_IMG)) $(call update-operator-dependencies,authorino-operator,$(AUTHORINO_OPERATOR_BUNDLE_IMG)) $(call update-operator-dependencies,dns-operator,$(DNS_OPERATOR_BUNDLE_IMG)) - $(OPERATOR_SDK) bundle validate ./bundle - $(MAKE) bundle-ignore-createdAt - echo "$$QUAY_EXPIRY_TIME_LABEL" >> bundle.Dockerfile .PHONY: bundle-ignore-createdAt bundle-ignore-createdAt: diff --git a/bundle/manifests/kuadrant-operator.clusterserviceversion.yaml b/bundle/manifests/kuadrant-operator.clusterserviceversion.yaml index 4d986248b..e921d5d5d 100644 --- a/bundle/manifests/kuadrant-operator.clusterserviceversion.yaml +++ b/bundle/manifests/kuadrant-operator.clusterserviceversion.yaml @@ -106,7 +106,7 @@ metadata: capabilities: Basic Install categories: Integration & Delivery containerImage: quay.io/kuadrant/kuadrant-operator:latest - createdAt: "2024-10-01T07:44:08Z" + createdAt: "2024-10-03T10:25:42Z" operators.operatorframework.io/builder: operator-sdk-v1.32.0 operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 repository: https://github.com/Kuadrant/kuadrant-operator diff --git a/bundle/metadata/annotations.yaml b/bundle/metadata/annotations.yaml index 56d5c4b99..57ed4ee6b 100644 --- a/bundle/metadata/annotations.yaml +++ b/bundle/metadata/annotations.yaml @@ -9,7 +9,8 @@ annotations: operators.operatorframework.io.metrics.builder: operator-sdk-v1.32.0 operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3 - # Annotations for testing. operators.operatorframework.io.test.mediatype.v1: scorecard+v1 operators.operatorframework.io.test.config.v1: tests/scorecard/ + # Custom annotations + com.redhat.openshift.versions: v4.12