From f6f2372a8b85a1ae1941fb9e6227293ebdd10e86 Mon Sep 17 00:00:00 2001 From: Ian Howell Date: Fri, 3 Sep 2021 13:25:10 -0500 Subject: [PATCH] AIAP: Cleanup kubeconfig after running aks script The `az aks get-credentials` command adds a context, user, and cluster to the kubeconfig. This cleans that up when CLEANUP_GROUP is true. Change-Id: I6563d278e4700363d4d33c2ab746ac18dd0e51dc --- tools/airship-in-a-pod/scripts/aiap-in-aks.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/airship-in-a-pod/scripts/aiap-in-aks.sh b/tools/airship-in-a-pod/scripts/aiap-in-aks.sh index b6832e92a..a0fb4eab6 100755 --- a/tools/airship-in-a-pod/scripts/aiap-in-aks.sh +++ b/tools/airship-in-a-pod/scripts/aiap-in-aks.sh @@ -63,4 +63,7 @@ done if ${CLEANUP_GROUP}; then echo "deleting resource group ${GROUP}..." az group delete --name ${GROUP} -y + kubectl config delete-user "clusterUser_${GROUP}_${CLUSTER}" + kubectl config delete-cluster "${CLUSTER}" + kubectl config delete-context "${CLUSTER}" fi