mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-12 06:29:23 +00:00
return 1 if there has been at least one failure
This commit is contained in:
parent
75268c6440
commit
0048283a93
1 changed files with 11 additions and 0 deletions
11
main.go
11
main.go
|
|
@ -174,10 +174,17 @@ func realMain() int {
|
|||
validationResults := make(chan []validationResult)
|
||||
var logWG sync.WaitGroup
|
||||
logWG.Add(1)
|
||||
|
||||
success := true
|
||||
|
||||
go func() {
|
||||
defer logWG.Done()
|
||||
for results := range validationResults {
|
||||
for _, result := range results {
|
||||
if result.err != nil {
|
||||
success = false
|
||||
}
|
||||
|
||||
o.Write(result.filename, result.kind, result.version, result.err, result.skipped)
|
||||
}
|
||||
}
|
||||
|
|
@ -215,6 +222,10 @@ func realMain() int {
|
|||
logWG.Wait()
|
||||
o.Flush()
|
||||
|
||||
if !success {
|
||||
return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue