From 706dc80f1764a247d30e18825e396dc1522c32f0 Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Mon, 18 Oct 2021 17:29:49 -0400 Subject: [PATCH 1/2] Revert "Lookup version from git when building bundle / catalog" This reverts commit 7fd4d46f6ecfbd29d3409df750336aba55514f9c. --- Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Makefile b/Makefile index 77cea147..f38d6a32 100644 --- a/Makefile +++ b/Makefile @@ -120,7 +120,6 @@ endif endif .PHONY: bundle -bundle: VERSION ?= $(shell git describe --tags) bundle: kustomize ## Generate bundle manifests and metadata, then validate generated files. operator-sdk generate kustomize manifests -q cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) @@ -129,12 +128,10 @@ bundle: kustomize ## Generate bundle manifests and metadata, then validate gener operator-sdk bundle validate ./bundle .PHONY: bundle-build -bundle-build: VERSION ?= $(shell git describe --tags) bundle-build: ## Build the bundle image. docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) . .PHONY: bundle-push -bundle-push: VERSION ?= $(shell git describe --tags) bundle-push: ## Push the bundle image. $(MAKE) docker-push IMG=$(BUNDLE_IMG) @@ -170,12 +167,10 @@ endif # This recipe invokes 'opm' in 'semver' bundle add mode. For more information on add modes, see: # https://github.com/operator-framework/community-operators/blob/7f1438c/docs/packaging-operator.md#updating-your-existing-operator .PHONY: catalog-build -catalog-build: VERSION ?= $(shell git describe --tags) catalog-build: opm ## Build a catalog image. $(OPM) index add --container-tool docker --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT) # Push the catalog image. .PHONY: catalog-push -catalog-push: VERSION ?= $(shell git describe --tags) catalog-push: ## Push a catalog image. $(MAKE) docker-push IMG=$(CATALOG_IMG) From 2e74c63c9e12ba1e2f5210a8b33ca98cac8fea74 Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Mon, 18 Oct 2021 17:35:50 -0400 Subject: [PATCH 2/2] Obtain version from git tags If you `git checkout ` this should just work. If you run this from the HEAD of devel, you will need to run `make docker-build docker-push` and override the appropriate image versions. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f38d6a32..2e9a82b2 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # To re-generate a bundle for another specific version without changing the standard setup, you can: # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2) # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) -VERSION ?= latest +VERSION ?= $(shell git describe --tags) # CHANNELS define the bundle channels used in the bundle. # Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")