Skip to content

Commit

Permalink
merge Makefile targets
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenschneider committed Dec 30, 2024
1 parent 21c758b commit f134a98
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f134a98

Please sign in to comment.