-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete target pools and forwarding rules with -q in guestbook.sh #5262
Conversation
} | ||
|
||
prepare-e2e | ||
|
||
trap "teardown" EXIT | ||
|
||
if gcloud config list compute/region --format text | grep 'compute.region: None'; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to hack out region instead, see e.g. https://github.com/GoogleCloudPlatform/kubernetes/blob/master/cluster/gce/util.sh#L625.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't that just take the ZONE from an env variable and use it to recreate the region, are you recommending a similar approach?
I could use sed/awk or something to parse out 'None' but I figured eitherway I won't know what to search for, and if the format of the string changes both will most likely break. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm recommending a similar approach given the e2e zone, which is what we have to do in other tests as well (I think there are a few other cases). You actually don't care what the gcloud default is, FWIW - I run my e2es in a different zone (though the same region, I guess), than my default zone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, updated.
d4c143b
to
7bc472a
Compare
7bc472a
to
1ae44c3
Compare
PTAL |
Delete target pools and forwarding rules with -q in guestbook.sh
Without -q gcloud prompts for confirmation before deleting rules, failing the e2e suite on local runs. This PR also adds checks for a default compute/region setting, without which gcloud will fail even with -q because it doesn't know which region to use.