@@ -38,6 +38,7 @@ OPERATOR_SDK_VERSION=v1.32.0
38
38
YQ_VERSION =v4.42.1
39
39
DEFAULT_CHANNEL ?= v$(shell cat ./version/version.go | grep "Version =" | awk '{ print $$3}' | tr -d '"' | cut -d '.' -f1,2)
40
40
CHANNELS ?= $(DEFAULT_CHANNEL )
41
+ OPENSHIFT_VERSIONS ?= v4.12-v4.17
41
42
42
43
LOCAL_OS := $(shell uname)
43
44
ifeq ($(LOCAL_OS ) ,Linux)
65
66
endif
66
67
67
68
# Default image repo
68
- QUAY_REGISTRY ?= quay.io/luzarragaben
69
+ QUAY_REGISTRY ?= quay.io/opencloudio
70
+ ICR_REIGSTRY ?= icr.io/cpopen
69
71
70
72
ifeq ($(BUILD_LOCALLY ) ,0)
71
73
ARTIFACTORYA_REGISTRY ?= "docker-na-public.artifactory.swg-devops.com/hyc-cloud-private-integration-docker-local/ibmcom"
@@ -89,7 +91,7 @@ OPERATOR_VERSION ?= 4.4.0
89
91
# Kind cluster name
90
92
KIND_CLUSTER_NAME ?= "odlm"
91
93
# Operator image tag for test
92
- OPERATOR_TEST_TAG ?= nolm-controller-cleanup
94
+ OPERATOR_TEST_TAG ?= dev-test
93
95
94
96
# Options for 'bundle-build'
95
97
ifneq ($(origin CHANNELS ) , undefined)
@@ -185,11 +187,11 @@ uninstall: manifests kustomize ## Uninstall CRDs from a cluster
185
187
$(KUSTOMIZE ) build config/crd | kubectl delete -f -
186
188
187
189
deploy : manifests kustomize # # Deploy controller in the configured Kubernetes cluster in ~/.kube/config
188
- cd config/manager && $(KUSTOMIZE ) edit set image quay .io/opencloudio /odlm=$(QUAY_REGISTRY ) /$(OPERATOR_IMAGE_NAME ) :$(OPERATOR_TEST_TAG )
190
+ cd config/manager && $(KUSTOMIZE ) edit set image icr .io/cpopen /odlm=$(QUAY_REGISTRY ) /$(OPERATOR_IMAGE_NAME ) :$(OPERATOR_TEST_TAG )
189
191
$(KUSTOMIZE ) build config/default | kubectl apply -f -
190
192
191
193
deploy-e2e : kustomize # # Deploy controller in the configured Kubernetes cluster in ~/.kube/config
192
- cd config/e2e/manager && $(KUSTOMIZE ) edit set image quay .io/opencloudio /odlm=$(QUAY_REGISTRY ) /$(OPERATOR_IMAGE_NAME ) :$(OPERATOR_TEST_TAG )
194
+ cd config/e2e/manager && $(KUSTOMIZE ) edit set image icr .io/cpopen /odlm=$(QUAY_REGISTRY ) /$(OPERATOR_IMAGE_NAME ) :$(OPERATOR_TEST_TAG )
193
195
$(KUSTOMIZE ) build config/e2e | kubectl apply -f -
194
196
195
197
# #@ Generate code and manifests
@@ -201,8 +203,11 @@ generate: controller-gen ## Generate code e.g. API etc.
201
203
$(CONTROLLER_GEN ) object:headerFile=" hack/boilerplate.go.txt" paths=" ./..."
202
204
203
205
bundle-manifests : yq
206
+ cd config/manager && $(KUSTOMIZE ) edit set image icr.io/cpopen/odlm=$(ICR_REIGSTRY ) /$(OPERATOR_IMAGE_NAME ) :$(OPERATOR_VERSION )
204
207
$(KUSTOMIZE ) build config/manifests | $(OPERATOR_SDK ) generate bundle \
205
208
-q --overwrite --version $(OPERATOR_VERSION ) $(BUNDLE_METADATA_OPTS )
209
+ echo " \n # OpenShift annotations." >> bundle/metadata/annotations.yaml ; \
210
+ echo " com.redhat.openshift.versions: $( OPENSHIFT_VERSIONS) " >> bundle/metadata/annotations.yaml ; \
206
211
$(OPERATOR_SDK ) bundle validate ./bundle
207
212
$(YQ ) eval-all -i ' .spec.relatedImages |= load("config/manifests/bases/operand-deployment-lifecycle-manager.clusterserviceversion.yaml").spec.relatedImages' bundle/manifests/operand-deployment-lifecycle-manager.clusterserviceversion.yaml
208
213
@# Need to replace fields this way to avoid changing PROJECT name and CSV file name, which may or may not impact CICD automation
@@ -258,19 +263,19 @@ kind-load-img:
258
263
build-operator-image : $(CONFIG_DOCKER_TARGET ) # # Build the operator image.
259
264
@echo " Building the $( OPERATOR_IMAGE_NAME) docker image for $( LOCAL_ARCH) ..."
260
265
@docker build -t $(OPERATOR_IMAGE_NAME ) -$(LOCAL_ARCH ) :$(VERSION ) \
261
- --build-arg VCS_REF=$(VCS_REF ) --build-arg VCS_URL=$(VCS_URL ) \
266
+ --build-arg VCS_REF=$(VCS_REF ) --build-arg VCS_URL=$(VCS_URL ) --build-arg RELEASE_VERSION= $( RELEASE_VERSION ) \
262
267
--build-arg GOARCH=$(LOCAL_ARCH ) -f Dockerfile .
263
268
264
269
build-operator-dev-image : # # Build the operator dev image.
265
270
@echo " Building the $( DEV_REGISTRY) /$( OPERATOR_IMAGE_NAME) docker image..."
266
271
@docker build -t $(DEV_REGISTRY ) /$(OPERATOR_IMAGE_NAME ) :$(VERSION ) \
267
- --build-arg VCS_REF=$(VCS_REF ) --build-arg VCS_URL=$(VCS_URL ) \
272
+ --build-arg VCS_REF=$(VCS_REF ) --build-arg VCS_URL=$(VCS_URL ) --build-arg RELEASE_VERSION= $( RELEASE_VERSION ) \
268
273
--build-arg GOARCH=$(LOCAL_ARCH ) -f Dockerfile .
269
274
270
275
build-test-operator-image : $(CONFIG_DOCKER_TARGET ) # # Build the operator test image.
271
276
@echo " Building the $( OPERATOR_IMAGE_NAME) docker image for testing..."
272
- @docker build -t $(QUAY_REGISTRY ) /$(OPERATOR_IMAGE_NAME ) :$(OPERATOR_TEST_TAG ) \
273
- --build-arg VCS_REF=$(VCS_REF ) --build-arg VCS_URL=$(VCS_URL ) \
277
+ @docker build -t $(DEV_REGISTRY ) /$(OPERATOR_IMAGE_NAME ) :$(OPERATOR_TEST_TAG ) \
278
+ --build-arg VCS_REF=$(VCS_REF ) --build-arg VCS_URL=$(VCS_URL ) --build-arg RELEASE_VERSION= $( RELEASE_VERSION ) \
274
279
--build-arg GOARCH=$(LOCAL_ARCH ) -f Dockerfile .
275
280
276
281
# #@ Release
@@ -285,13 +290,13 @@ build-push-image: $(CONFIG_DOCKER_TARGET) build-operator-image ## Build and pus
285
290
@docker push $(ARTIFACTORYA_REGISTRY ) /$(OPERATOR_IMAGE_NAME ) -$(LOCAL_ARCH ) :$(VERSION )
286
291
287
292
build-push-bundle-image : yq
288
- @docker build -f bundle.Dockerfile -t $(QUAY_REGISTRY ) /$(BUNDLE_IMAGE_NAME ) -$(LOCAL_ARCH ) :$(VERSION ) .
293
+ @docker build -f bundle.Dockerfile -t $(ICR_REIGSTRY ) /$(BUNDLE_IMAGE_NAME ) -$(LOCAL_ARCH ) :$(VERSION ) .
289
294
@echo " Pushing the $( BUNDLE_IMAGE_NAME) docker image for $( LOCAL_ARCH) ..."
290
- @docker push $(QUAY_REGISTRY ) /$(BUNDLE_IMAGE_NAME ) -$(LOCAL_ARCH ) :$(VERSION )
295
+ @docker push $(ICR_REIGSTRY ) /$(BUNDLE_IMAGE_NAME ) -$(LOCAL_ARCH ) :$(VERSION )
291
296
292
297
build-catalog-source :
293
- @opm -u docker index add --bundles $(QUAY_REGISTRY ) /$(BUNDLE_IMAGE_NAME ) -$(LOCAL_ARCH ) :$(VERSION ) --tag $(QUAY_REGISTRY ) /$(OPERATOR_IMAGE_NAME ) -catalog:$(VERSION )
294
- @docker push $(QUAY_REGISTRY ) /$(OPERATOR_IMAGE_NAME ) -catalog:$(VERSION )
298
+ @opm -u docker index add --bundles $(ICR_REIGSTRY ) /$(BUNDLE_IMAGE_NAME ) -$(LOCAL_ARCH ) :$(VERSION ) --tag $(ICR_REIGSTRY ) /$(OPERATOR_IMAGE_NAME ) -catalog:$(VERSION )
299
+ @docker push $(ICR_REIGSTRY ) /$(OPERATOR_IMAGE_NAME ) -catalog:$(VERSION )
295
300
296
301
build-catalog : build-push-bundle-image build-catalog-source
297
302
0 commit comments