diff --git a/Makefile b/Makefile index aca43e4..82ca5e7 100644 --- a/Makefile +++ b/Makefile @@ -335,11 +335,21 @@ bundle: $(KUSTOMIZE) $(OPERATOR_SDK) $(YQ) manifests ## Generate bundle manifest V="$(IMG)" $(YQ) eval '.metadata.annotations.containerImage = strenv(V)' -i config/manifests/bases/limitador-operator.clusterserviceversion.yaml # Generate bundle $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle -q --overwrite --version $(BUNDLE_VERSION) $(BUNDLE_METADATA_OPTS) + $(MAKE) bundle-post-generate # Validate bundle manifests $(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 + .PHONY: bundle-ignore-createdAt bundle-ignore-createdAt: # Since operator-sdk 1.26.0, `make bundle` changes the `createdAt` field from the bundle diff --git a/bundle/manifests/limitador-operator.clusterserviceversion.yaml b/bundle/manifests/limitador-operator.clusterserviceversion.yaml index 7f8b906..7884094 100644 --- a/bundle/manifests/limitador-operator.clusterserviceversion.yaml +++ b/bundle/manifests/limitador-operator.clusterserviceversion.yaml @@ -225,6 +225,7 @@ spec: keywords: - api - rate-limit + - kuadrant links: - name: Limitador Operator url: https://github.com/Kuadrant/limitador-operator diff --git a/bundle/metadata/annotations.yaml b/bundle/metadata/annotations.yaml index 4514a2e..ba6a9be 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 diff --git a/config/manifests/bases/limitador-operator.clusterserviceversion.yaml b/config/manifests/bases/limitador-operator.clusterserviceversion.yaml index 7da9503..0b991f8 100644 --- a/config/manifests/bases/limitador-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/limitador-operator.clusterserviceversion.yaml @@ -43,6 +43,7 @@ spec: keywords: - api - rate-limit + - kuadrant links: - name: Limitador Operator url: https://github.com/Kuadrant/limitador-operator