From eaff6898a427713c5b18feaf54d201a2c90f0be9 Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Wed, 13 Oct 2021 14:54:55 -0400 Subject: [PATCH 1/2] Ignore files generated by bundle / catalog Make targets --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 493c6418..d154a6f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ *~ .cache/ /bin +/bundle +/bundle_tmp* +/bundle.Dockerfile From 7fd4d46f6ecfbd29d3409df750336aba55514f9c Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Wed, 13 Oct 2021 14:55:50 -0400 Subject: [PATCH 2/2] Lookup version from git when building bundle / catalog VERSION = "latest" breaks `make bundle` and `make catalog`. --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index ad2ba1a6..ee15d832 100644 --- a/Makefile +++ b/Makefile @@ -120,6 +120,7 @@ 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) @@ -127,10 +128,12 @@ 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) @@ -166,10 +169,12 @@ 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)