From b75932d1aca5e4d5d5f617f703311c0028ad0a47 Mon Sep 17 00:00:00 2001 From: oraz Date: Mon, 8 Apr 2024 13:53:16 +0300 Subject: [PATCH 1/2] Update bundle image Run 'VERSION=SOME_VERSION' prior to running the bundle-run or bundle-run-update targets to modify the installed or replaced bundle CSV --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 754ec314..5d9d7f65 100644 --- a/Makefile +++ b/Makefile @@ -197,6 +197,12 @@ export BUNDLE_RUN_NAMESPACE ?= openshift-workload-availability bundle-run: operator-sdk create-ns ## Run bundle image. Default NS is "openshift-workload-availability", redefine BUNDLE_RUN_NAMESPACE to override it. $(OPERATOR_SDK) -n $(BUNDLE_RUN_NAMESPACE) run bundle $(BUNDLE_IMG) +.PHONY: bundle-run-update +bundle-run-update: operator-sdk ## Update bundle image. +# An older bundle image CSV should exist in the cluster, and in the same namespace, +# Default NS is "openshift-workload-availability", redefine OPERATOR_NAMESPACE to override it. + $(OPERATOR_SDK) -n $(OPERATOR_NAMESPACE) run bundle-upgrade $(BUNDLE_IMG) + .PHONY: bundle-cleanup bundle-cleanup: operator-sdk ## Remove bundle installed via bundle-run $(OPERATOR_SDK) -n $(BUNDLE_RUN_NAMESPACE) cleanup $(OPERATOR_NAME) From 31ace8461d4ef5429010b421018e57a65c662295 Mon Sep 17 00:00:00 2001 From: oraz Date: Mon, 8 Apr 2024 13:54:45 +0300 Subject: [PATCH 2/2] Change var name BUNDLE_RUN_NAMESPACE to OPERATOR_NAMESPACE OPERATOR_NAMESPACE is widely used in other Medik8s operators --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5d9d7f65..e0499998 100644 --- a/Makefile +++ b/Makefile @@ -72,6 +72,7 @@ endif BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) OPERATOR_NAME ?= fence-agents-remediation +OPERATOR_NAMESPACE ?= openshift-workload-availability # IMAGE_TAG_BASE defines the docker.io namespace and part of the image name for remote images. # This variable is used to construct full image tags for bundle and catalog images. @@ -193,9 +194,8 @@ test-no-verify: go-verify manifests generate fmt vet fix-imports envtest ginkgo $(GINKGO) -r --keep-going --randomize-all --require-suite --vv --coverprofile cover.out ./api/... ./pkg/... ./controllers/... .PHONY: bundle-run -export BUNDLE_RUN_NAMESPACE ?= openshift-workload-availability -bundle-run: operator-sdk create-ns ## Run bundle image. Default NS is "openshift-workload-availability", redefine BUNDLE_RUN_NAMESPACE to override it. - $(OPERATOR_SDK) -n $(BUNDLE_RUN_NAMESPACE) run bundle $(BUNDLE_IMG) +bundle-run: operator-sdk create-ns ## Run bundle image. Default NS is "openshift-workload-availability", redefine OPERATOR_NAMESPACE to override it. + $(OPERATOR_SDK) -n $(OPERATOR_NAMESPACE) run bundle $(BUNDLE_IMG) .PHONY: bundle-run-update bundle-run-update: operator-sdk ## Update bundle image. @@ -205,11 +205,11 @@ bundle-run-update: operator-sdk ## Update bundle image. .PHONY: bundle-cleanup bundle-cleanup: operator-sdk ## Remove bundle installed via bundle-run - $(OPERATOR_SDK) -n $(BUNDLE_RUN_NAMESPACE) cleanup $(OPERATOR_NAME) + $(OPERATOR_SDK) -n $(OPERATOR_NAMESPACE) cleanup $(OPERATOR_NAME) .PHONY: create-ns create-ns: ## Create namespace - $(KUBECTL) get ns $(BUNDLE_RUN_NAMESPACE) 2>&1> /dev/null || $(KUBECTL) create ns $(BUNDLE_RUN_NAMESPACE) + $(KUBECTL) get ns $(OPERATOR_NAMESPACE) 2>&1> /dev/null || $(KUBECTL) create ns $(OPERATOR_NAMESPACE) ##@ Build