mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-05-28 04:04:39 -04:00
Detect whether a cluster exists before deleting it
This commit is contained in:
parent
d249236fa9
commit
a221e68c0c
1 changed files with 4 additions and 2 deletions
|
|
@ -401,6 +401,8 @@ function test-teardown() {
|
|||
function kube-down() {
|
||||
echo "... in gke:kube-down()" >&2
|
||||
detect-project >&2
|
||||
"${GCLOUD}" ${CMD_GROUP:-} container clusters delete --project="${PROJECT}" \
|
||||
--zone="${ZONE}" "${CLUSTER_NAME}" --quiet
|
||||
if "${GCLOUD}" ${CMD_GROUP:-} container clusters describe --project="${PROJECT}" --zone="${ZONE}" "${CLUSTER_NAME}" --quiet &>/dev/null; then
|
||||
"${GCLOUD}" ${CMD_GROUP:-} container clusters delete --project="${PROJECT}" \
|
||||
--zone="${ZONE}" "${CLUSTER_NAME}" --quiet
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue