mirror of https://github.com/k3s-io/k3s
Detect whether a cluster exists before deleting it
parent
d249236fa9
commit
a221e68c0c
|
@ -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 New Issue