Skip to content
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

Conversation

edsantiago
Copy link
Member

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]

@openshift-ci-robot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 18, 2021
@edsantiago edsantiago changed the title runner.sh : deal with bash 'set -e' [v3.0] runner.sh : deal with bash 'set -e' Jan 18, 2021
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]>
@edsantiago edsantiago force-pushed the release_deal_with_set_minus_e--3.0 branch from 986b635 to 46df46a Compare January 18, 2021 22:13
@@ -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 '')
Copy link
Collaborator

@zhangguanzhang zhangguanzhang Jan 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dev=$(bin/podman info |& grep -- -dev || echo -n '')
dev=$(bin/podman info |& grep -- -dev || true )

Copy link
Collaborator

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

Copy link
Member Author

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree with you

@zhangguanzhang
Copy link
Collaborator

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2021
@openshift-merge-robot openshift-merge-robot merged commit ade8a92 into containers:v3.0 Jan 19, 2021
@edsantiago edsantiago deleted the release_deal_with_set_minus_e--3.0 branch January 19, 2021 12:50
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants