Skip to content

Commit

Permalink
rename func
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendan Ryan committed Aug 13, 2019
1 parent 48b7464 commit 598083a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var RootCmd = &cobra.Command{
log.Error(err)
os.Exit(1)
}
success = isSuccess(results)
success = !hasErrors(results)

for _, r := range results {
err = outputManager.Put(r)
Expand Down Expand Up @@ -126,8 +126,8 @@ var RootCmd = &cobra.Command{
aggResults = append(aggResults, results...)
}

// only use result of isSuccess check if `success` is currently truthy
success = success && isSuccess(aggResults)
// only use result of hasErrors check if `success` is currently truthy
success = success && !hasErrors(aggResults)
}

// flush any final logs which may be sitting in the buffer
Expand All @@ -143,13 +143,13 @@ var RootCmd = &cobra.Command{
},
}

func isSuccess(res []kubeval.ValidationResult) bool {
func hasErrors(res []kubeval.ValidationResult) bool {
for _, r := range res {
if len(r.Errors) > 0 {
return false
return true
}
}
return true
return false
}

func aggregateFiles(args []string) ([]string, error) {
Expand Down

0 comments on commit 598083a

Please sign in to comment.