mirror of
https://github.com/aquasecurity/kube-bench.git
synced 2025-01-13 09:10:54 +00:00
Add missing error output if JSON output can't be emitted
This commit is contained in:
parent
44136fa080
commit
1be52fb304
@ -112,6 +112,8 @@ func runChecks(t check.NodeType) {
|
||||
if jsonFmt {
|
||||
out, err := controls.JSON()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "failed to output in JSON format: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
fmt.Println(string(out))
|
||||
|
Loading…
Reference in New Issue
Block a user