File tree 1 file changed +33
-0
lines changed
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -515,3 +515,36 @@ func TestPodEnvDuplicated(t *testing.T) {
515
515
diff := cmp .Diff (expected , actual )
516
516
assert .Empty (t , diff )
517
517
}
518
+
519
+ func TestMultipleIgnoreAnnotations (t * testing.T ) {
520
+ t .Parallel ()
521
+ s , err := testScore (config.Configuration {
522
+ VerboseOutput : 0 ,
523
+ AllFiles : []ks.NamedReader {testFile ("kube-score-ignore-annotations.yaml" )},
524
+ UseIgnoreChecksAnnotation : true ,
525
+ })
526
+ assert .Nil (t , err )
527
+ assert .Len (t , s , 1 )
528
+
529
+ tested := false
530
+ skipped := false
531
+
532
+ for _ , o := range s {
533
+ for _ , c := range o .Checks {
534
+ // implied by the ignore container-resources annotation
535
+ if c .Check .ID == "container-ephemeral-storage-request-and-limit" {
536
+ assert .True (t , c .Skipped )
537
+ skipped = true
538
+ }
539
+ // a default check
540
+ if c .Check .ID == "container-image-pull-policy" {
541
+ assert .False (t , c .Skipped )
542
+ assert .Equal (t , scorecard .GradeCritical , c .Grade )
543
+ tested = true
544
+ }
545
+ assert .Equal (t , "kube-score-ignore-annotations" , o .ObjectMeta .Name )
546
+ }
547
+ }
548
+ assert .True (t , tested )
549
+ assert .True (t , skipped )
550
+ }
You can’t perform that action at this time.
0 commit comments