From 5ddd6b621e48bb8b4ee290cc861090280335decf Mon Sep 17 00:00:00 2001 From: Bryce Soghigian Date: Fri, 24 May 2024 10:39:46 -0700 Subject: [PATCH] chore: adding makefile helpers + pulling acr name from the environment --- Makefile | 2 +- Makefile-az.mk | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d8204f6c4..3a93ed537 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ e2etests: ## Run the e2e suite against your local cluster # -count 1: prevents caching # -timeout: If a test binary runs longer than TEST_TIMEOUT, panic # -v: verbose output - cd test && CLUSTER_NAME=${CLUSTER_NAME} go test \ + cd test && CLUSTER_NAME=${CLUSTER_NAME} AZURE_ACR_NAME=${AZURE_ACR_NAME} go test \ -p 1 \ -count 1 \ -timeout ${TEST_TIMEOUT} \ diff --git a/Makefile-az.mk b/Makefile-az.mk index 874b78db0..8298f6f2e 100755 --- a/Makefile-az.mk +++ b/Makefile-az.mk @@ -330,3 +330,12 @@ az-helm-install-snapshot: az-configure-values ## Install Karpenter snapshot rele az-rmcrds: ## Delete Karpenter CRDs kubectl delete crd nodepools.karpenter.sh nodeclaims.karpenter.sh aksnodeclasses.karpenter.azure.com + +az-cleanenv: + kubectl delete nodepools --all + for nodeclaim in $$(kubectl get nodeclaims --output=jsonpath={.items..metadata.name}); do \ + kubectl patch nodeclaim $$nodeclaim --type=json -p '[{"op": "remove", "path": "/metadata/finalizers"}]'; \ + done + kubectl delete nodeclaims --all + kubectl delete aksnodeclasses --all + kubectl delete pods -n default --all