@@ -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)
1414VERSION ?= $(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+
1623MAJOR_VERSION = $(shell cat major-version)
1724
1825# CHANNELS define the bundle channels used in the bundle.
@@ -275,7 +282,6 @@ endif
275282validate-manifests : generate manifests
276283 $(MAKE ) check-missing-files
277284
278-
279285.PHONY : bundle
280286bundle : 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
509517run : prepare-run # # Run a freshly compiled manager against kind
510518ifdef RUN_YAML
511519 kubectl apply -f $(RUN_YAML)
512520endif
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