-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[v3.0] runner.sh : deal with bash 'set -e' #9013
[v3.0] runner.sh : deal with bash 'set -e' #9013
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Release trigger script failed[1] because the entire script runs under 'set -e'; so a 'grep -- -dev' that finds no results will cause a nonzero exit status and hence the entire script to fail. Work around that. [1] https://cirrus-ci.com/task/4541290882793472 Signed-off-by: Ed Santiago <[email protected]>
986b635
to
46df46a
Compare
@@ -210,7 +210,8 @@ function _run_release() { | |||
bin/podman info | |||
|
|||
msg "Checking podman release (or potential release) criteria." | |||
dev=$(bin/podman info |& grep -- -dev) | |||
# We're running under 'set -eo pipefail'; make sure this statement passes | |||
dev=$(bin/podman info |& grep -- -dev || echo -n '') |
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.
dev=$(bin/podman info |& grep -- -dev || echo -n '') | |
dev=$(bin/podman info |& grep -- -dev || true ) |
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.
maybe this will be better
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.
@zhangguanzhang thank you, why do you prefer that form? I chose echo -n ''
because the expression is intended as a string capture, and I wanted to make it easily clear to a maintainer that the fallthrough is an empty string. true
is logically equivalent, but could make a future maintainer stop to think it through. (At least, that was my thinking earlier today, and I still think it holds). What do you like about the true
form?
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.
agree with you
/lgtm |
Release trigger script failed[1] because the entire script
runs under 'set -e'; so a 'grep -- -dev' that finds no
results will cause a nonzero exit status and hence the
entire script to fail. Work around that.
[1] https://cirrus-ci.com/task/4541290882793472
Signed-off-by: Ed Santiago [email protected]