When running kubeaudit on the cli, we generally yield an exit code other than 0 if the report contains errors.
However, when we run it with the sarif format, we get 0 even when we have errors. This happens, because we're returning
here to avoid printing extra info to the console. This means we never reach this line.
Fixes #575
Type of change
[x] Bug fix :bug:
[ ] New feature :sparkles:
[ ] This change requires a documentation update :book:
[ ] Breaking changes :warning:
How Has This Been Tested?
[x] Test A
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
Description
When running
kubeaudit
on the cli, we generally yield an exit code other than 0 if the report contains errors.However, when we run it with the sarif format, we get 0 even when we have errors. This happens, because we're returning here to avoid printing extra info to the console. This means we never reach this line.
Fixes #575
Type of change
How Has This Been Tested?
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 see2
Checklist: