From a56241e13e66b561b3ee7a85a689d32f5212e388 Mon Sep 17 00:00:00 2001 From: Jing Ai Date: Wed, 11 Oct 2017 14:32:25 -0700 Subject: [PATCH] Minior fix on getting subnet mode by gcloud --- cluster/gce/util.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index e62f362e542..49ec5981726 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -779,7 +779,7 @@ function create-network() { gcloud compute networks create --project "${NETWORK_PROJECT}" "${NETWORK}" --mode=auto else PREEXISTING_NETWORK=true - PREEXISTING_NETWORK_MODE="$(gcloud compute networks list ${NETWORK} --project ${NETWORK_PROJECT} --format='value(x_gcloud_mode)' || true)" + PREEXISTING_NETWORK_MODE="$(gcloud compute networks list --filter="name=('${NETWORK}')" --project ${NETWORK_PROJECT} --format='value(x_gcloud_subnet_mode)' || true)" echo "Found existing network ${NETWORK} in ${PREEXISTING_NETWORK_MODE} mode." fi @@ -937,7 +937,7 @@ function delete-subnetworks() { if [[ ${ENABLE_IP_ALIASES:-} != "true" ]]; then if [[ "${ENABLE_BIG_CLUSTER_SUBNETS}" = "true" ]]; then # If running in custom mode network we need to delete subnets - mode="$(gcloud compute networks list ${NETWORK} --project ${NETWORK_PROJECT} --format='value(x_gcloud_mode)' || true)" + mode="$(gcloud compute networks list --filter="name=('${NETWORK}')" --project ${NETWORK_PROJECT} --format='value(x_gcloud_subnet_mode)' || true)" if [[ "${mode}" == "custom" ]]; then echo "Deleting default subnets..." # This value should be kept in sync with number of regions.