Skip to content

Commit 315e378

Browse files
authored
Add corresponding metadata to pass RH certification (#2389) (#2436)
* add OCP version annotation in bundle matedata * add metadata label into container image * set versioned image in manifest * general new bundle manifest at end of next-csv.sh * update version in Makefile and annotations --------- Signed-off-by: Daniel Fan <[email protected]>
1 parent 61aa05f commit 315e378

File tree

7 files changed

+32
-9
lines changed

7 files changed

+32
-9
lines changed

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ FROM docker-na-public.artifactory.swg-devops.com/hyc-cloud-private-edge-docker-l
2525

2626
ARG VCS_REF
2727
ARG VCS_URL
28+
ARG RELEASE_VERSION
2829

2930
LABEL org.label-schema.vendor="IBM" \
3031
org.label-schema.name="ibm common service operator" \
@@ -34,7 +35,10 @@ LABEL org.label-schema.vendor="IBM" \
3435
org.label-schema.license="Licensed Materials - Property of IBM" \
3536
org.label-schema.schema-version="1.0" \
3637
name="common-service-operator" \
38+
maintainer="IBM" \
3739
vendor="IBM" \
40+
version=$RELEASE_VERSION \
41+
release=$RELEASE_VERSION \
3842
description="Deploy ODLM and IBM Common Services" \
3943
summary="Deploy ODLM and IBM Common Services"
4044

Makefile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ YQ_VERSION=v4.27.3
2323
KUSTOMIZE_VERSION=v5.0.0
2424
OPERATOR_SDK_VERSION=v1.38.0
2525
CONTROLLER_TOOLS_VERSION ?= v0.14.0
26+
OPENSHIFT_VERSIONS ?= v4.12-v4.17
2627

2728
CSV_PATH=bundle/manifests/ibm-common-service-operator.clusterserviceversion.yaml
2829

@@ -37,7 +38,7 @@ VERSION ?= $(shell git describe --exact-match 2> /dev/null || \
3738
git describe --match=$(git rev-parse --short=8 HEAD) --always --dirty --abbrev=8)
3839
RELEASE_VERSION ?= $(shell cat ./version/version.go | grep "Version =" | awk '{ print $$3}' | tr -d '"')
3940
PREVIOUS_VERSION := 3.23.0
40-
LATEST_VERSION ?= latest
41+
LATEST_VERSION ?= 4.6.12
4142

4243
LOCAL_OS := $(shell uname)
4344
ifeq ($(LOCAL_OS),Linux)
@@ -79,6 +80,8 @@ REGISTRY ?= "docker-na-public.artifactory.swg-devops.com/hyc-cloud-private-scrat
7980
OPERATOR_IMAGE_NAME ?= common-service-operator
8081
# Current Operator bundle image name
8182
BUNDLE_IMAGE_NAME ?= common-service-operator-bundle
83+
# Current Operator image with registry
84+
IMG ?= icr.io/cpopen/common-service-operator:$(LATEST_VERSION)
8285

8386
CHANNELS := v4.6
8487
DEFAULT_CHANNEL := v4.6
@@ -174,13 +177,13 @@ uninstall: manifests ## Uninstall CRDs from a cluster
174177
$(KUSTOMIZE) build config/crd | kubectl delete -f -
175178

176179
deploy: manifests ## Deploy controller in the configured Kubernetes cluster in ~/.kube/config
177-
cd config/manager && $(KUSTOMIZE) edit set image quay.io/opencloudio/common-service-operator=$(QUAY_REGISTRY)/$(OPERATOR_IMAGE_NAME):$(RELEASE_VERSION)
180+
cd config/manager && $(KUSTOMIZE) edit set image icr.io/cpopen/common-service-operator=$(QUAY_REGISTRY)/$(OPERATOR_IMAGE_NAME):$(RELEASE_VERSION)
178181
$(KUSTOMIZE) build config/default | kubectl apply -f -
179182

180183
build-dev-image: cloudpak-theme.jar
181184
@echo "Building the $(OPERATOR_IMAGE_NAME) docker dev image for $(LOCAL_ARCH)..."
182185
@docker build -t $(REGISTRY)/$(OPERATOR_IMAGE_NAME)-$(LOCAL_ARCH):dev \
183-
--build-arg VCS_REF=$(VCS_REF) --build-arg VCS_URL=$(VCS_URL) \
186+
--build-arg VCS_REF=$(VCS_REF) --build-arg VCS_URL=$(VCS_URL) --build-arg RELEASE_VERSION=$(RELEASE_VERSION) \
184187
--build-arg GOARCH=$(LOCAL_ARCH) -f Dockerfile .
185188
@docker push $(REGISTRY)/$(OPERATOR_IMAGE_NAME)-$(LOCAL_ARCH):dev
186189

@@ -228,8 +231,11 @@ generate: controller-gen ## Generate code e.g. API etc.
228231
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
229232

230233
bundle-manifests: clis
234+
cd config/manager && $(KUSTOMIZE) edit set image icr.io/cpopen/common-service-operator=${IMG}
231235
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle \
232236
-q --overwrite --version $(RELEASE_VERSION) $(BUNDLE_METADATA_OPTS)
237+
echo "\n # OpenShift annotations." >> bundle/metadata/annotations.yaml ;\
238+
echo " com.redhat.openshift.versions: $(OPENSHIFT_VERSIONS)" >> bundle/metadata/annotations.yaml ;\
233239
$(OPERATOR_SDK) bundle validate ./bundle
234240
$(YQ) eval -i '.metadata.annotations."olm.skipRange" = ">=3.3.0 <${RELEASE_VERSION}"' ${CSV_PATH}
235241
$(YQ) eval -i '.spec.webhookdefinitions[0].deploymentName = "ibm-common-service-operator" | .spec.webhookdefinitions[1].deploymentName = "ibm-common-service-operator"' ${CSV_PATH}
@@ -256,7 +262,7 @@ e2e-test: ## Run e2e test
256262
build-operator-image: $(CONFIG_DOCKER_TARGET) cloudpak-theme.jar ## Build the operator image.
257263
@echo "Building the $(OPERATOR_IMAGE_NAME) docker image for $(LOCAL_ARCH)..."
258264
@docker build -t $(OPERATOR_IMAGE_NAME)-$(LOCAL_ARCH):$(VERSION) \
259-
--build-arg VCS_REF=$(VCS_REF) --build-arg VCS_URL=$(VCS_URL) \
265+
--build-arg VCS_REF=$(VCS_REF) --build-arg VCS_URL=$(VCS_URL) --build-arg RELEASE_VERSION=$(RELEASE_VERSION) \
260266
--build-arg GOARCH=$(LOCAL_ARCH) -f Dockerfile .
261267

262268
##@ Release

bundle/manifests/ibm-common-service-operator.clusterserviceversion.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ metadata:
2222
]
2323
capabilities: Seamless Upgrades
2424
cloudPakThemesVersion: styles467.css
25-
containerImage: icr.io/cpopen/common-service-operator:latest
26-
createdAt: "2025-03-05T20:28:45Z"
25+
containerImage: icr.io/cpopen/common-service-operator:4.6.12
26+
createdAt: "2025-03-06T19:45:25Z"
2727
description: The IBM Cloud Pak foundational services operator is used to deploy IBM foundational services.
2828
nss.operator.ibm.com/managed-operators: ibm-common-service-operator
2929
nss.operator.ibm.com/managed-webhooks: ""
@@ -377,7 +377,7 @@ spec:
377377
value: ibm-common-service-operator
378378
- name: CPFS_UTILS_IMAGE
379379
value: icr.io/cpopen/cpfs/cpfs-utils:latest
380-
image: icr.io/cpopen/common-service-operator:latest
380+
image: icr.io/cpopen/common-service-operator:4.6.12
381381
imagePullPolicy: IfNotPresent
382382
livenessProbe:
383383
failureThreshold: 10

bundle/metadata/annotations.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ annotations:
1313
# Annotations for testing.
1414
operators.operatorframework.io.test.mediatype.v1: scorecard+v1
1515
operators.operatorframework.io.test.config.v1: tests/scorecard/
16+
17+
# OpenShift annotations.
18+
com.redhat.openshift.versions: v4.12-v4.17

common/scripts/next-csv.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
5555

5656
# update cs operator channel in Makefile & bundle.Dockerfile & annotations.yaml
5757
sed -i "s/$CURRENT_CHANNEL/$NEW_CHANNEL/g" Makefile
58+
sed -i "s/$CURRENT_DEV_CSV/$NEW_DEV_CSV/g" Makefile
5859
echo "Updated the Makefile"
5960

6061
sed -i "s/$CURRENT_CHANNEL/$NEW_CHANNEL/g" bundle.Dockerfile
@@ -91,6 +92,7 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
9192

9293
# update cs operator channel in Makefile & bundle.Dockerfile & annotations.yaml
9394
sed -i "" "s/$CURRENT_CHANNEL/$NEW_CHANNEL/g" Makefile
95+
sed -i "" "s/$CURRENT_DEV_CSV/$NEW_DEV_CSV/g" Makefile
9496
echo "Updated the Makefile"
9597

9698
sed -i "" "s/$CURRENT_CHANNEL/$NEW_CHANNEL/g" bundle.Dockerfile
@@ -101,4 +103,6 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
101103

102104
else
103105
echo "Not support on other operating systems"
104-
fi
106+
fi
107+
108+
make generate-all

config/manager/kustomization.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
resources:
22
- manager.yaml
3+
apiVersion: kustomize.config.k8s.io/v1beta1
4+
kind: Kustomization
5+
images:
6+
- name: icr.io/cpopen/common-service-operator
7+
newName: icr.io/cpopen/common-service-operator
8+
newTag: 4.6.12

config/manifests/bases/ibm-common-service-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
alm-examples: '[]'
66
capabilities: Seamless Upgrades
77
cloudPakThemesVersion: styles467.css
8-
containerImage: icr.io/cpopen/common-service-operator:latest
8+
containerImage: icr.io/cpopen/common-service-operator:4.6.12
99
createdAt: "2020-10-19T21:38:33Z"
1010
description: The IBM Cloud Pak foundational services operator is used to deploy
1111
IBM foundational services.

0 commit comments

Comments
 (0)