Merge pull request #35223 from fejta/err

Automatic merge from submit-queue

Detect whether a cluster exists before deleting it

Now with correct CLUSTER_NAME variable.
This commit is contained in:
Kubernetes Submit Queue 2016-10-21 02:28:58 -07:00 committed by GitHub
commit 64d2045514

View File

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