Merge pull request #60102 from satyasm/gcloud_net_flag

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fixes #54017, remove deprecated --mode flag

**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #54017

**Special notes for your reviewer**:

**Release note**:

```release-note
remove deprecated --mode flag in check-network-mode
```
pull/8/head
Kubernetes Submit Queue 2018-04-05 17:53:00 -07:00 committed by GitHub
commit 4cfa2e4dfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 6 deletions

View File

@ -1644,14 +1644,8 @@ function check-existing() {
fi
}
# TODO(#54017): Remove below logics for handling deprecated network mode field.
# `x_gcloud_mode` was replaced by `x_gcloud_subnet_mode` in gcloud 175.0.0 and
# the content changed as well. Keeping such logic to make the transition eaiser.
function check-network-mode() {
local mode="$(gcloud compute networks list --filter="name=('${NETWORK}')" --project ${NETWORK_PROJECT} --format='value(x_gcloud_subnet_mode)' || true)"
if [[ -z "${mode}" ]]; then
mode="$(gcloud compute networks list --filter="name=('${NETWORK}')" --project ${NETWORK_PROJECT} --format='value(x_gcloud_mode)' || true)"
fi
# The deprecated field uses lower case. Convert to upper case for consistency.
echo "$(echo $mode | tr [a-z] [A-Z])"
}