Skip to content

Commit

Permalink
Return a non-zero status code for failed plugins
Browse files Browse the repository at this point in the history
Fixes #404

Signed-off-by: Chuck Ha <chuck@heptio.com>
  • Loading branch information
Chuck Ha committed Jul 3, 2018
1 parent 4f61a01 commit 0e03182
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/sonobuoy/app/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,21 @@ func getStatus(cmd *cobra.Command, args []string) {
} else {
err = printSummary(os.Stdout, status)
}

if err != nil {
errlog.LogError(err)
os.Exit(1)
}
os.Exit(exitCode(status))
}

func exitCode(status *aggregation.Status) int {
switch status.Status {
case aggregation.FailedStatus:
return 1
default:
return 0
}
}

func humanReadableStatus(str string) string {
Expand Down

0 comments on commit 0e03182

Please sign in to comment.