When running kubeaudit on the cli, we generally yield an exit code other than 0 if the report contains errors. Following the pattern for json and logrus, we're not running os.Exit(rootConfig.exitCode) when we generate a sarif report.
this is causing issues, since now when a sarif report with results is generated, we get exit code 0.
ENVIRONMENT
Kubeaudit version: 0.22.0
Kubeaudit install method: DIY-BUILD
STEPS TO REPRODUCE
use one of the manifest files in the repo to test. Example: auditors/privileged/fixtures/privileged-nil.yml
go run ./cmd/main.go all -f auditors/privileged/fixtures/privileged-nil.yml --format=sarif
when you run echo $? you should see 0
EXPECTED RESULTS
2
ACTUAL RESULTS
0
ADDITIONAL INFORMATION
FEATURE IDEA
[x] If the maintainers agree with the feature as described here, I intend to submit a Pull Request myself.1
Proposal:
1This is the quickest way to get a new feature! We reserve the right to close feature requests, even ones we like, if the proposer does not intend to contribute to the feature and it doesn't fit in our current roadmap.
ISSUE TYPE
BUG REPORT
SUMMARY
When running
kubeaudit
on the cli, we generally yield an exit code other than 0 if the report contains errors. Following the pattern for json and logrus, we're not runningos.Exit(rootConfig.exitCode)
when we generate a sarif report.this is causing issues, since now when a sarif report with results is generated, we get exit code 0.
ENVIRONMENT
STEPS TO REPRODUCE
use one of the manifest files in the repo to test. Example:
auditors/privileged/fixtures/privileged-nil.yml
go run ./cmd/main.go all -f auditors/privileged/fixtures/privileged-nil.yml --format=sarif
when you run
echo $?
you should see 0EXPECTED RESULTS
2
ACTUAL RESULTS
0
ADDITIONAL INFORMATION
FEATURE IDEA
Proposal:
1 This is the quickest way to get a new feature! We reserve the right to close feature requests, even ones we like, if the proposer does not intend to contribute to the feature and it doesn't fit in our current roadmap.