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
This commit is contained in:
Ian Howell 2021-09-03 13:25:10 -05:00 committed by Matt McEuen
parent 0cb8e0f5f4
commit f6f2372a8b
1 changed files with 3 additions and 0 deletions

View File

@ -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