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.