Skip to content

Commit

Permalink
Merge pull request #189 from clobrano/create-ns-for-bundle-run-0
Browse files Browse the repository at this point in the history
Create Namespace if it does not exist
  • Loading branch information
openshift-merge-bot[bot] authored Feb 15, 2024
2 parents 5df6e10 + 85bcc71 commit 21e347c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,18 @@ test: envtest manifests generate fmt vet ## Run tests.
go test ./api/... ./controllers/... ./pkg/... -coverprofile cover.out -v ${TEST_OPS}

.PHONY: bundle-run
export BUNDLE_RUN_NAMESPACE ?= openshift-operators
bundle-run: operator-sdk ## Run bundle image. Default NS is "openshift-operators", redefine BUNDLE_RUN_NAMESPACE to override it.
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-cleanup
bundle-cleanup: operator-sdk ## Remove bundle installed via bundle-run
$(OPERATOR_SDK) -n $(BUNDLE_RUN_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)

##@ Build

.PHONY: build
Expand Down

0 comments on commit 21e347c

Please sign in to comment.