@@ -23,6 +23,7 @@ YQ_VERSION=v4.27.3
23
23
KUSTOMIZE_VERSION =v5.0.0
24
24
OPERATOR_SDK_VERSION =v1.38.0
25
25
CONTROLLER_TOOLS_VERSION ?= v0.14.0
26
+ OPENSHIFT_VERSIONS ?= v4.12-v4.17
26
27
27
28
CSV_PATH =bundle/manifests/ibm-common-service-operator.clusterserviceversion.yaml
28
29
@@ -37,7 +38,7 @@ VERSION ?= $(shell git describe --exact-match 2> /dev/null || \
37
38
git describe --match=$(git rev-parse --short=8 HEAD ) --always --dirty --abbrev=8)
38
39
RELEASE_VERSION ?= $(shell cat ./version/version.go | grep "Version =" | awk '{ print $$3}' | tr -d '"')
39
40
PREVIOUS_VERSION := 3.23.0
40
- LATEST_VERSION ?= latest
41
+ LATEST_VERSION ?= 4.6.12
41
42
42
43
LOCAL_OS := $(shell uname)
43
44
ifeq ($(LOCAL_OS ) ,Linux)
@@ -79,6 +80,8 @@ REGISTRY ?= "docker-na-public.artifactory.swg-devops.com/hyc-cloud-private-scrat
79
80
OPERATOR_IMAGE_NAME ?= common-service-operator
80
81
# Current Operator bundle image name
81
82
BUNDLE_IMAGE_NAME ?= common-service-operator-bundle
83
+ # Current Operator image with registry
84
+ IMG ?= icr.io/cpopen/common-service-operator:$(LATEST_VERSION )
82
85
83
86
CHANNELS := v4.6
84
87
DEFAULT_CHANNEL := v4.6
@@ -174,13 +177,13 @@ uninstall: manifests ## Uninstall CRDs from a cluster
174
177
$(KUSTOMIZE ) build config/crd | kubectl delete -f -
175
178
176
179
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 )
178
181
$(KUSTOMIZE ) build config/default | kubectl apply -f -
179
182
180
183
build-dev-image : cloudpak-theme.jar
181
184
@echo " Building the $( OPERATOR_IMAGE_NAME) docker dev image for $( LOCAL_ARCH) ..."
182
185
@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 ) \
184
187
--build-arg GOARCH=$(LOCAL_ARCH ) -f Dockerfile .
185
188
@docker push $(REGISTRY ) /$(OPERATOR_IMAGE_NAME ) -$(LOCAL_ARCH ) :dev
186
189
@@ -228,8 +231,11 @@ generate: controller-gen ## Generate code e.g. API etc.
228
231
$(CONTROLLER_GEN ) object:headerFile=" hack/boilerplate.go.txt" paths=" ./..."
229
232
230
233
bundle-manifests : clis
234
+ cd config/manager && $(KUSTOMIZE ) edit set image icr.io/cpopen/common-service-operator=${IMG}
231
235
$(KUSTOMIZE ) build config/manifests | $(OPERATOR_SDK ) generate bundle \
232
236
-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 ; \
233
239
$(OPERATOR_SDK ) bundle validate ./bundle
234
240
$(YQ ) eval -i ' .metadata.annotations."olm.skipRange" = ">=3.3.0 <${RELEASE_VERSION}"' ${CSV_PATH}
235
241
$(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
256
262
build-operator-image : $(CONFIG_DOCKER_TARGET ) cloudpak-theme.jar # # Build the operator image.
257
263
@echo " Building the $( OPERATOR_IMAGE_NAME) docker image for $( LOCAL_ARCH) ..."
258
264
@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 ) \
260
266
--build-arg GOARCH=$(LOCAL_ARCH ) -f Dockerfile .
261
267
262
268
# #@ Release
0 commit comments