diff --git a/Makefile.core.mk b/Makefile.core.mk index f8718504e5..60105e24fc 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -154,6 +154,8 @@ BUNDLE_MANIFEST_DATE := $(shell cat bundle/manifests/${OPERATOR_NAME}.clusterser BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION) # BUNDLE_GEN_FLAGS are the flags passed to the operator-sdk generate bundle command +# We are overwriting the version as we are appending a suffix for nightly builds, +# otherwise it would be taken directly from helm values. BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) # USE_IMAGE_DIGESTS defines if images are resolved via tags or digests @@ -171,6 +173,8 @@ endif # Default values and flags used when rendering chart templates locally HELM_VALUES_FILE ?= chart/values.yaml HELM_TEMPL_DEF_FLAGS ?= --include-crds --values $(HELM_VALUES_FILE) +# When true, all operand images will be added to the HELM_VALUES_FILE automatically +PATCH_HELM_VALUES ?= true TODAY ?= $(shell date -I) @@ -512,10 +516,12 @@ operator-chart: download-istio-charts # pull the charts first as they are requir sed -i -e "s/^\(version: \).*$$/\1${VERSION}/g" \ -e "s/^\(appVersion: \).*$$/\1\"${VERSION}\"/g" chart/Chart.yaml sed -i -e "s|^\(image: \).*$$|\1${IMAGE}|g" \ - -e "s/^\( version: \).*$$/\1${VERSION}/g" chart/values.yaml + -e "s/^\( version: \).*$$/\1${VERSION}/g" ${HELM_VALUES_FILE} # adding all component images to values # when building the bundle, helm generated base CSV is passed to the operator-sdk. With USE_IMAGE_DIGESTS=true, operator-sdk replaces all pullspecs with tags by digests and adds spec.relatedImages field automatically - @hack/patch-values.sh chart/values.yaml +ifeq ($(PATCH_HELM_VALUES), true) + @hack/patch-values.sh ${HELM_VALUES_FILE} +endif .PHONY: update-istio update-istio: ## Update the Istio commit hash in the 'latest' entry in versions.yaml to the latest commit in the branch.