terraform/gke: clean up kubeconfig better, still not perfect

This commit is contained in:
Mitchell Hashimoto 2018-08-18 15:19:09 -07:00
parent f2e2bd7a52
commit b2f7df6d77
No known key found for this signature in database
GPG key ID: 744E147AA52F5B0A

View file

@ -36,4 +36,10 @@ resource "null_resource" "kubectl" {
on_failure = "continue"
command = "kubectl config get-clusters | grep ${google_container_cluster.cluster.name} | xargs -n1 kubectl config delete-cluster"
}
provisioner "local-exec" {
when = "destroy"
on_failure = "continue"
command = "kubectl config get-contexts | grep ${google_container_cluster.cluster.name} | xargs -n1 kubectl config delete-context"
}
}