-
Notifications
You must be signed in to change notification settings - Fork 378
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 0 code when --one_shot is set #576
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
Codecov Report
@@ Coverage Diff @@
## main #576 +/- ##
=======================================
Coverage 59.87% 59.87%
=======================================
Files 66 66
Lines 7222 7222
=======================================
Hits 4324 4324
Misses 2645 2645
Partials 253 253 Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
Benchmark ResultBenchmark diff with base
|
Nice, I think the exit 1 should be inside the if statement just a few lines above. Can you add one there to exit 1 if the error is logged? |
This comment has been minimized.
This comment has been minimized.
I was able to use --one_shot to test mtail file syntax but ab3cbf2 added os.Exit(1) so I cannot use exit code to tell if a file is valid or not. Change exit code from 1 to 0, if there was a syntax error then earlier code will catch it.
Thanks! |
This comment has been minimized.
This comment has been minimized.
Unit Test Results 1 files 27 suites 20m 36s ⏱️ Results for commit 64be5cd. |
`prometheus/common` made a breaking change in `expfmt` with prometheus/common/#576 so we need to change the prometheus encoder constructor and the dependency version of both `common` and `client_golang` in the same PR.
I was able to use --one_shot to test mtail file syntax but ab3cbf2 added os.Exit(1) so I cannot use exit code to tell if a file is valid or not.
Change exit code from 1 to 0, if there was a syntax error then earlier code will catch it.