Skip to content

Commit 32ac452

Browse files
authored
CLOUDP-277877: Use NEXT_VERSION on make runs (#1855)
* Use NEXT_VERSION on runs Avoids version error such as: "version of the resource $Resource is higher than the operator version $VERSION" * Fix compilation version for make run
1 parent 6c59b78 commit 32ac452

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ DOCKER_SBOM_PLUGIN_VERSION=0.6.1
1313
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
1414
VERSION ?= $(shell git describe --tags --dirty --broken | cut -c 2-)
1515

16+
# NEXT_VERSION represents a version that is higher than anything released
17+
# VERSION default value does not play well with the run target which might end up failing
18+
# with errors such as:
19+
# "version of the resource $Resource is higher than the operator version $VERSION"
20+
# This happens if you use exported YAMLs from CLI and the dirty version is deemed a pre-release
21+
NEXT_VERSION = 99.99.99-next
22+
1623
MAJOR_VERSION = $(shell cat major-version)
1724

1825
# CHANNELS define the bundle channels used in the bundle.
@@ -275,7 +282,6 @@ endif
275282
validate-manifests: generate manifests
276283
$(MAKE) check-missing-files
277284

278-
279285
.PHONY: bundle
280286
bundle: manifests ## Generate bundle manifests and metadata, then validate generated files.
281287
@echo "Building bundle $(VERSION)"
@@ -503,13 +509,16 @@ install-credentials: set-namespace ## Install the Atlas credentials for the Oper
503509
$(ATLAS_KEY_SECRET_NAME) atlas.mongodb.com/type=credentials
504510

505511
.PHONY: prepare-run
506-
prepare-run: generate vet manifests manager run-kind install-crds install-credentials
512+
prepare-run: generate vet manifests run-kind install-crds install-credentials
513+
rm bin/manager
514+
$(MAKE) manager VERSION=$(NEXT_VERSION)
507515

508516
.PHONY: run
509517
run: prepare-run ## Run a freshly compiled manager against kind
510518
ifdef RUN_YAML
511519
kubectl apply -f $(RUN_YAML)
512520
endif
521+
VERSION=$(NEXT_VERSION) \
513522
OPERATOR_POD_NAME=$(OPERATOR_POD_NAME) \
514523
OPERATOR_NAMESPACE=$(OPERATOR_NAMESPACE) \
515524
bin/manager --object-deletion-protection=false --log-level=$(RUN_LOG_LEVEL) \

0 commit comments

Comments
 (0)