@@ -60,6 +60,9 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
6060# BUNDLE_IMAGE defines the image:tag used for the bundle.
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 )
63+ BUNDLE_IMAGE_TAG ?= gpu-operator-bundle:$(VERSION )
64+ BUNDLE_CSV_FILE ?= bundle/manifests/gpu-operator-certified.clusterserviceversion.yaml
65+ OPERATOR_IMAGE_TAG ?= gpu-operator:$(VERSION )
6366
6467# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
6568ifeq (,$(shell go env GOBIN) )
@@ -126,16 +129,23 @@ bundle: manifests install-tools
126129 $(KUSTOMIZE ) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION ) $(BUNDLE_METADATA_OPTS )
127130 operator-sdk bundle validate ./bundle
128131
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+ @echo " Bundle CSV updated successfully"
137+
129138# Build the bundle image.
130- build-bundle-image :
139+ build-bundle-image : update-bundle-csv
131140 $(DOCKER ) build \
132141 --build-arg DEFAULT_CHANNEL=$(DEFAULT_CHANNEL ) \
133142 --build-arg GIT_COMMIT=$(GIT_COMMIT ) \
134- -f docker/bundle.Dockerfile -t $(BUNDLE_IMAGE ) .
143+ -f docker/bundle.Dockerfile -t $(BUNDLE_IMAGE ) -t $( BUNDLE_IMAGE_TAG ) .
135144
136145# Push the bundle image.
137146push-bundle-image : build-bundle-image
138147 $(DOCKER ) push $(BUNDLE_IMAGE )
148+ $(DOCKER ) push $(BUNDLE_IMAGE_TAG )
139149
140150# Define local and dockerized golang targets
141151
0 commit comments