diff --git a/Makefile b/Makefile index 8934b37192..4f4c17cd28 100644 --- a/Makefile +++ b/Makefile @@ -886,13 +886,23 @@ $(KUSTOMIZE): $(HACK_BIN) # Options for 'bundle-build' -ifneq ($(origin CHANNELS), undefined) -BUNDLE_CHANNELS := --channels=$(CHANNELS) -endif + +# Set the channels to the current release branch, unless +# we got another one passed to us. Channel should be +# release-vX.YY +CHANNEL ?= $(shell git branch --show-current) +BUNDLE_CHANNEL = --channels=$(if \ + $(findstring release-v1,$(CHANNEL)),$(CHANNEL),\ + $(error Channel for bundle should be a release branch of the format 'release-vX.YY', not '$(CHANNEL)')) + +# We only specify one channel so we don't need to set a +# default, but if we have one then include it. ifneq ($(origin DEFAULT_CHANNEL), undefined) BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL) endif -BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) + +# Collate our metadata +BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNEL) $(BUNDLE_DEFAULT_CHANNEL) BUNDLE_BASE_DIR ?= $(BUILD_DIR)/bundle/$(VERSION) BUNDLE_CRD_DIR ?= $(BUNDLE_BASE_DIR)/crds @@ -931,7 +941,8 @@ bundle-generate: manifests $(KUSTOMIZE) $(OPERATOR_SDK_BARE) bundle-manifests --verbose \ --manifests \ --package tigera-operator \ - --metadata $(BUNDLE_METADATA_OPTS) + --metadata \ + $(BUNDLE_METADATA_OPTS) # Update a generated bundle so that it can be certified. .PHONY: update-bundle diff --git a/hack/gen-bundle/update-bundle.sh b/hack/gen-bundle/update-bundle.sh index df160b35ff..c8eb47d41e 100755 --- a/hack/gen-bundle/update-bundle.sh +++ b/hack/gen-bundle/update-bundle.sh @@ -118,6 +118,8 @@ done # Set some basic required CSV fields description_value=$(yq ".metadata.annotations.description" config/manifests/bases/tigera-operator.clusterserviceversion.yaml) +icon_media_type=$(yq ".spec.icon[0].mediatype" config/manifests/bases/tigera-operator.clusterserviceversion.yaml) +icon_base64_data=$(yq ".spec.icon[0].base64data" config/manifests/bases/tigera-operator.clusterserviceversion.yaml) echo " #### DESCRIPTION IS ${description_value} ### " @@ -126,6 +128,12 @@ cat <<- EOF >> ${YAML_UPDATE_FILE} .spec.description = "${description_value}" | EOF +# Add in the icon +cat <<- EOF >> ${YAML_UPDATE_FILE} + .spec.icon[0].mediatype = "${icon_media_type}" | + .spec.icon[0].base64data = "${icon_base64_data}" | +EOF + # Set the previous version of the operator that this version replaces. if [[ "${PREV_VERSION}" != "0.0.0" ]]; then