Add RELEASE_INFRA_PUSH related code to support pushes from kubernetes/release.#28922
Conversation
There was a problem hiding this comment.
[[ -n "${RELEASE_INFRA_PUSH:-}" ]]
There was a problem hiding this comment.
Well RELEASE_INFRA_PUSH is a convenient true or false bool so we can code it so it reads nice like that.
The other (unsightly) option is:
if [[ "${RELEASE_INFRA_PUSH:-}" == "true" ]]
But -n will always be true unless we change the default.
There was a problem hiding this comment.
Another nice option in bash is to use 0 or 1 for your bool values and take advantage of the double paren eval. Both are certainly more Go or Python like than the overly decorated expression above (== true):
So both read nicely:
RELEASE_INFRA_PUSH=1
if ((RELEASE_INFRA_PUSH)); then
Or:
RELEASE_INFRA_PUSH=true
if $RELEASE_INFRA_PUSH; then
I have started to prefer the former in the past couple of years, but since most of this infra uses true/false, I thought I'd stick with that.
There was a problem hiding this comment.
Okay, seems reasonable. It's just different from the norm in this repo.
There was a problem hiding this comment.
minor nit - scripts in this repo generally use ${VAR} rather than $VAR.
There was a problem hiding this comment.
Indeed. Will correct next iteration.
|
For testing this, you can edit the file to set whatever environment variables will make it do its thing and then be sure to remove them once you've seen it work. |
cf271f6 to
ae9232d
Compare
|
ping. |
|
cc @rmmh test-infra on-call |
There was a problem hiding this comment.
If $FEDERATION is false then federation_flag never gets set and this will fail from nounset, I think.
ae9232d to
ae18034
Compare
|
GCE e2e build/test passed for commit ae18034. |
|
Ok, I think it's reasonable. |
|
Automatic merge from submit-queue |
ref #16529