terraform/gke: clean up kubeconfig better, still not perfect
This commit is contained in:
parent
f2e2bd7a52
commit
b2f7df6d77
1 changed files with 6 additions and 0 deletions
|
@ -36,4 +36,10 @@ resource "null_resource" "kubectl" {
|
||||||
on_failure = "continue"
|
on_failure = "continue"
|
||||||
command = "kubectl config get-clusters | grep ${google_container_cluster.cluster.name} | xargs -n1 kubectl config delete-cluster"
|
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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue