@@ -61,6 +61,8 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
6161# You can use it as an arg. (E.g make bundle-build BUNDLE_IMAGE=<some-registry>/<project-name-bundle>:<tag>)
6262BUNDLE_IMAGE ?= gpu-operator-bundle:$(VERSION )
6363BUNDLE_IMAGE_TAG ?= gpu-operator-bundle:$(VERSION )
64+ BUNDLE_CSV_FILE ?= bundle/manifests/gpu-operator-certified.clusterserviceversion.yaml
65+ OPERATOR_IMAGE_TAG ?= gpu-operator:$(VERSION )
6466
6567# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
6668ifeq (,$(shell go env GOBIN) )
@@ -127,6 +129,14 @@ bundle: manifests install-tools
127129 $(KUSTOMIZE ) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION ) $(BUNDLE_METADATA_OPTS )
128130 operator-sdk bundle validate ./bundle
129131
132+ # update the bundle image tag in csv file
133+ update-bundle-csv :
134+ @echo " Updating GPU operator image in $( BUNDLE_CSV_FILE) to $( OPERATOR_IMAGE_TAG) "
135+ @sed -i -e ' s|gpu-operator:[^ " ]*|$(OPERATOR_IMAGE_TAG)|g' $(BUNDLE_CSV_FILE )
136+ @git diff --exit-code -- $(BUNDLE_CSV_FILE )
137+ @cat $(BUNDLE_CSV_FILE )
138+ @echo " Bundle CSV updated successfully"
139+
130140# Build the bundle image.
131141build-bundle-image :
132142 $(DOCKER ) build \
@@ -135,7 +145,7 @@ build-bundle-image:
135145 -f docker/bundle.Dockerfile -t $(BUNDLE_IMAGE ) -t $(BUNDLE_IMAGE_TAG ) .
136146
137147# Push the bundle image.
138- push-bundle-image : build-bundle-image
148+ push-bundle-image : update-bundle-csv build-bundle-image
139149 $(DOCKER ) push $(BUNDLE_IMAGE )
140150 $(DOCKER ) push $(BUNDLE_IMAGE_TAG )
141151
0 commit comments