File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff 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
155155func  aggregateFiles (args  []string ) ([]string , error ) {
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments