Skip to content

Commit 598083a

Browse files
author
Brendan Ryan
committed
rename func
1 parent 48b7464 commit 598083a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ var RootCmd = &cobra.Command{
7474
log.Error(err)
7575
os.Exit(1)
7676
}
77-
success = isSuccess(results)
77+
success = !hasErrors(results)
7878

7979
for _, r := range results {
8080
err = outputManager.Put(r)
@@ -126,8 +126,8 @@ var RootCmd = &cobra.Command{
126126
aggResults = append(aggResults, results...)
127127
}
128128

129-
// only use result of isSuccess check if `success` is currently truthy
130-
success = success && isSuccess(aggResults)
129+
// only use result of hasErrors check if `success` is currently truthy
130+
success = success && !hasErrors(aggResults)
131131
}
132132

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

146-
func isSuccess(res []kubeval.ValidationResult) bool {
146+
func hasErrors(res []kubeval.ValidationResult) bool {
147147
for _, r := range res {
148148
if len(r.Errors) > 0 {
149-
return false
149+
return true
150150
}
151151
}
152-
return true
152+
return false
153153
}
154154

155155
func aggregateFiles(args []string) ([]string, error) {

0 commit comments

Comments
 (0)