Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions hack/gen-bundle/update-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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} ### "

Expand All @@ -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
Expand Down