Skip to content

Commit

Permalink
Automatically adjust default release channel
Browse files Browse the repository at this point in the history
This will make sure that the channel field is pre-populated with a good
default when we run the release workflow.

Signed-off-by: Daniel Grimm <dgrimm@redhat.com>
  • Loading branch information
dgn committed Sep 24, 2024
1 parent c5e8021 commit 2ebad3e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
bundle_channels:
description: "Bundle channels"
required: true
default: "candidates"
default: dev-0.2
is_draft_release:
description: "Draft release"
type: boolean
Expand Down
14 changes: 11 additions & 3 deletions Makefile.core.mk
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ GINKGO_FLAGS := $(if $(VERBOSE),-v) $(if $(CI),--no-color)
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=candidate,fast,stable)
# - use environment variables to overwrite this value (e.g export CHANNELS="candidate,fast,stable")
CHANNELS ?= ${MINOR_VERSION}
CHANNEL_PREFIX := dev
ifneq (,$(findstring release-,$(shell git rev-parse --abbrev-ref HEAD)))
CHANNEL_PREFIX = stable
endif

CHANNELS ?= $(CHANNEL_PREFIX)-$(MINOR_VERSION)
ifneq ($(origin CHANNELS), undefined)
BUNDLE_CHANNELS = --channels=\"$(CHANNELS)\"
endif
Expand Down Expand Up @@ -381,7 +386,7 @@ gen-charts: ## Pull charts from istio repository.
gen: gen-all-except-bundle bundle ## Generate everything.

.PHONY: gen-all-except-bundle
gen-all-except-bundle: operator-name operator-chart controller-gen gen-api gen-charts gen-manifests gen-code gen-api-docs
gen-all-except-bundle: operator-name operator-chart controller-gen gen-api gen-charts gen-manifests gen-code gen-api-docs github-workflow

.PHONY: gen-check
gen-check: gen restore-manifest-dates check-clean-repo ## Verify that changes in generated resources have been checked in.
Expand Down Expand Up @@ -425,6 +430,9 @@ operator-chart:
sed -i -e "s|^\(image: \).*$$|\1${IMAGE}|g" \
-e "s/^\( version: \).*$$/\1${VERSION}/g" chart/values.yaml

github-workflow:
sed -i -e '1,/default:/ s/^\(.*default:\).*$$/\1 ${CHANNELS}/' .github/workflows/release.yaml

.PHONY: update-istio
update-istio: ## Update the Istio commit hash in the 'latest' entry in versions.yaml to the latest commit in the branch.
@hack/update-istio.sh
Expand Down Expand Up @@ -624,7 +632,7 @@ git-hook: gitleaks ## Installs gitleaks as a git pre-commit hook.
chmod +x .git/hooks/pre-commit; \
fi

.SILENT: helm $(HELM) $(LOCALBIN) deploy-yaml gen-api operator-name operator-chart
.SILENT: helm $(HELM) $(LOCALBIN) deploy-yaml gen-api operator-name operator-chart github-workflow

COMMON_IMPORTS ?= lint-all lint-scripts lint-copyright-banner lint-go lint-yaml lint-helm format-go tidy-go check-clean-repo update-common
.PHONY: $(COMMON_IMPORTS)
Expand Down
2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=sailoperator
LABEL operators.operatorframework.io.bundle.channels.v1="0.2"
LABEL operators.operatorframework.io.bundle.channels.v1="dev-0.2"
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.36.1
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4
Expand Down
2 changes: 1 addition & 1 deletion bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ annotations:
operators.operatorframework.io.bundle.manifests.v1: manifests/
operators.operatorframework.io.bundle.metadata.v1: metadata/
operators.operatorframework.io.bundle.package.v1: sailoperator
operators.operatorframework.io.bundle.channels.v1: "0.2"
operators.operatorframework.io.bundle.channels.v1: "dev-0.2"
operators.operatorframework.io.metrics.builder: operator-sdk-v1.36.1
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v4
Expand Down

0 comments on commit 2ebad3e

Please sign in to comment.