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

[3.5] github/govuln: don't swallow govulncheck errors #18254

Conversation

ivanvc
Copy link
Member

@ivanvc ivanvc commented Jun 29, 2024

By running find -exec, an error exit code doesn't properly return the error if there's a failure in a command executed. Use xargs to force an exit with an error when a command fails to run.

Refer to https://github.com/ivanvc/etcd/actions/runs/9727114371/job/26846300969 for an example of a run that should have failed but didn't.
After updating the workflow to use xargs, this is a build with a failure: https://github.com/ivanvc/etcd/actions/runs/9727235294/job/26846574320

Fixes #18173
Related to Slack thread: https://kubernetes.slack.com/archives/C3HD8ARJ5/p1719591918822359

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

By running `find -exec`, an error exit code doesn't properly return the
error if there's a failure in a command executed. Use `xargs` to force
an exit with error when a command fails to run.

Signed-off-by: Ivan Valdes <ivan@vald.es>
@ivanvc ivanvc changed the title github/govuln: don't swallow govulncheck errors [3.5] github/govuln: don't swallow govulncheck errors Jun 29, 2024
Copy link
Member

@jmhbnz jmhbnz left a comment

Choose a reason for hiding this comment

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

LGTM - Nice catch @ivanvc, thanks for your close attention on this.

Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for the fix!

@ahrtr ahrtr merged commit 5b4c548 into etcd-io:release-3.5 Jun 30, 2024
25 checks passed
@ivanvc ivanvc deleted the release-3.5-dont-swallow-govulncheck-exit-code branch June 30, 2024 13:43
@ivanvc ivanvc mentioned this pull request Jul 3, 2024
4 tasks
aneesh1 pushed a commit to DataDog/etcd that referenced this pull request Sep 24, 2024
…-govulncheck-exit-code

[3.5] github/govuln: don't swallow govulncheck errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

4 participants