mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 03:03:59 +00:00
Minior fix on getting subnet mode by gcloud
This commit is contained in:
parent
e57accbd03
commit
a56241e13e
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user