From 03a01fbe9fafb18060860f5d83ce00934817cdab Mon Sep 17 00:00:00 2001 From: Michael Burman Date: Fri, 9 Jun 2023 17:02:29 +0300 Subject: [PATCH] Add KIND_CLUSTER make variable to allow targeting different kind clusters --- Makefile | 11 +++++++---- hack/cluster.sh | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6333096e6..496c04e17 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,9 @@ IMAGE_TAG_BASE ?= $(ORG)/cass-operator M_INTEG_DIR ?= all +# KIND_CLUSTER is the kind context to target with the make commands to load images +KIND_CLUSTER ?= kind + # BUNDLE_IMG defines the image:tag used for the bundle. # You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=/:) BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION) @@ -165,8 +168,8 @@ docker-build: ## Build docker image with the manager. .PHONY: docker-kind docker-kind: docker-build ## Build docker image and load to kind cluster - kind load docker-image ${IMG} - kind load docker-image ${IMG_LATEST} + kind load docker-image --name $(KIND_CLUSTER) ${IMG} + kind load docker-image --name $(KIND_CLUSTER) ${IMG_LATEST} .PHONY: docker-push docker-push: ## Build and push docker image with the manager. @@ -184,8 +187,8 @@ docker-logger-push: ## Push system-logger-image .PHONY: docker-logger-kind docker-logger-kind: docker-logger-build ## Build system-logger image and load to kind cluster - kind load docker-image ${LOG_IMG} - kind load docker-image ${LOG_IMG_LATEST} + kind load docker-image --name $(KIND_CLUSTER) ${LOG_IMG} + kind load docker-image --name $(KIND_CLUSTER) ${LOG_IMG_LATEST} ##@ Deployment diff --git a/hack/cluster.sh b/hack/cluster.sh index 18dbb434e..58a81ce3e 100755 --- a/hack/cluster.sh +++ b/hack/cluster.sh @@ -12,7 +12,7 @@ if [ "${running}" != 'true' ]; then fi # create a cluster with the local registry enabled in containerd -cat <