Skip to content

Commit

Permalink
Merge pull request #164 from Kuadrant/bundle-custom-modifications
Browse files Browse the repository at this point in the history
Bundle custom modifications
  • Loading branch information
eguzki authored Oct 10, 2024
2 parents 3dead94 + bd43c64 commit bd4757e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ spec:
keywords:
- api
- rate-limit
- kuadrant
links:
- name: Limitador Operator
url: https://github.com/Kuadrant/limitador-operator
Expand Down
3 changes: 2 additions & 1 deletion bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ spec:
keywords:
- api
- rate-limit
- kuadrant
links:
- name: Limitador Operator
url: https://github.com/Kuadrant/limitador-operator
Expand Down

0 comments on commit bd4757e

Please sign in to comment.