mirror of
https://github.com/aquasecurity/kube-bench.git
synced 2025-01-27 16:11:09 +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 {
|
if jsonFmt {
|
||||||
out, err := controls.JSON()
|
out, err := controls.JSON()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "failed to output in JSON format: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(string(out))
|
fmt.Println(string(out))
|
||||||
|
Loading…
Reference in New Issue
Block a user