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

Exit with a non-zero status on cmd execution errors #774

Merged
merged 1 commit into from
Oct 5, 2022

Conversation

jvrplmlmn
Copy link
Contributor

This PR attempts to address a behaviour change that made it via #766

We were able to identify this issue at GrafanaLabs because we run Tanka in our CI pipelines and on errors, Tanka was still exiting with 0, executing the subsequent steps of the pipeline.

@jvrplmlmn jvrplmlmn self-assigned this Oct 5, 2022
@jvrplmlmn jvrplmlmn force-pushed the jvrplmlmn/rootcmd-fatal-on-error branch from 10d6ff2 to b4c11d9 Compare October 5, 2022 10:21
@jvrplmlmn jvrplmlmn marked this pull request as ready for review October 5, 2022 10:22
@julienduchesne julienduchesne merged commit f590ad4 into main Oct 5, 2022
@julienduchesne julienduchesne deleted the jvrplmlmn/rootcmd-fatal-on-error branch October 5, 2022 10:52
julienduchesne added a commit that referenced this pull request Oct 13, 2022
When an error occurs, it is ultimately brought to the `main.go` file where it is printed for the user (or machine)
Using log.Fatal garbles the error by not rendering newlines

This reverts #774 but adds an os.Exit(1) which is an alternative fix to what the PR did
julienduchesne added a commit that referenced this pull request Oct 13, 2022
When an error occurs, it is ultimately brought to the `main.go` file where it is printed for the user (or machine)
Using log.Fatal garbles the error by not rendering newlines

This reverts #774 but adds an os.Exit(1) which is an alternative fix to what the PR did
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants