Skip to content

Commit

Permalink
Merge pull request #463 from chuckha/status-exit-code
Browse files Browse the repository at this point in the history
Return a non-zero status code for failed plugins
  • Loading branch information
timothysc authored Jul 9, 2018
2 parents d33f8f6 + 0e03182 commit 87cf469
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 87cf469

Please sign in to comment.