From f134a986b9639c4583ef95482ea2eef438f14292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Schneider?= <56670304+soerenschneider@users.noreply.github.com> Date: Mon, 30 Dec 2024 11:41:04 +0100 Subject: [PATCH] merge Makefile targets --- Makefile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 9dddda7..cde946d 100644 --- a/Makefile +++ b/Makefile @@ -132,15 +132,6 @@ bootstrap-kind-cluster: .check-binary-docker .check-binary-kind .check-binary-ku deploy-2a: .check-binary-helm ## Deploy 2A to the management cluster $(HELM) install hmc $(HMC_REPO) --version $(HMC_VERSION) -n $(HMC_NAMESPACE) --create-namespace -##@ Tear down management cluster - -.PHONY: delete-kind-cluster -delete-kind-cluster: .check-binary-kind ## Tear down local kind cluster - @if $(KIND) get clusters | grep -q $(KIND_CLUSTER_NAME); then\ - $(KIND) kind delete cluster --name=$(KIND_CLUSTER_NAME);\ - else\ - echo "Can't find kind cluster with the name $(KIND_CLUSTER_NAME)";\ - fi ##@ TBD @@ -440,14 +431,20 @@ certs/platform-engineer1/platform-engineer1.csr: certs/platform-engineer1/platfo certs/platform-engineer1/platform-engineer1.crt: certs/platform-engineer1/platform-engineer1.csr certs/ca/ca.crt certs/ca/ca.key openssl x509 -req -in certs/platform-engineer1/platform-engineer1.csr -CA certs/ca/ca.crt -CAkey certs/ca/ca.key -CAcreateserial -out certs/platform-engineer1/platform-engineer1.crt -days 360 +##@ Tear down managed cluster .PHONY: cleanup-clusters cleanup-clusters: clean-certs # use the explicit --context option to be specific about which cluster should be used to prevent disaster kubectl --context=kind-$(KIND_CLUSTER_NAME) delete managedclusters.hmc.mirantis.com -n $(HMC_NAMESPACE) --all +##@ Tear down management cluster .PHONY: cleanup cleanup: cleanup-clusters clean-certs - $(KIND) delete cluster --name=$(KIND_CLUSTER_NAME); + @if $(KIND) get clusters | grep -q $(KIND_CLUSTER_NAME); then\ + $(KIND) kind delete cluster --name=$(KIND_CLUSTER_NAME);\ + else\ + echo "Can't find kind cluster with the name $(KIND_CLUSTER_NAME)";\ + fi .PHONY: clean-certs clean-certs: