@@ -23,7 +23,7 @@ violation[msg] {
2323func TestGetPolicyCommentBlocks (t * testing.T ) {
2424 policy := `
2525# First description
26- # @Kinds core/Pods apps/Deployments apps/DaemonSet
26+ # @Kinds core/Pods apps/Deployments apps/DaemonSet networking.istio.io/v1alpha3/VirtualService
2727violation[msg] {
2828 false
2929}`
@@ -38,7 +38,7 @@ violation[msg] {
3838 t .Errorf ("expected policy block to exist, but one did not." )
3939 }
4040
41- expectedAPIGroupCount := 2
41+ expectedAPIGroupCount := 3
4242 if len (actual [0 ].APIGroups ) != expectedAPIGroupCount {
4343 t .Errorf ("expected %v APIGroups to exists but %v were found" , expectedAPIGroupCount , len (actual [0 ].APIGroups ))
4444 }
@@ -51,11 +51,19 @@ violation[msg] {
5151 t .Errorf ("expected policy block to contain 'apps' APIGroup, but was not found." )
5252 }
5353
54+ if ! contains (actual [0 ].APIGroups , "networking.istio.io/v1alpha3" ) {
55+ t .Errorf ("expected policy block to contain 'apps' APIGroup, but was not found." )
56+ }
57+
5458 if ! contains (actual [0 ].Kinds , "Pods" ) {
5559 t .Errorf ("expected policy block to contain 'Pods' Kind, but was not found." )
5660 }
5761
5862 if ! contains (actual [0 ].Kinds , "Deployments" ) {
5963 t .Errorf ("expected policy block to contain 'Deployments' Kind, but was not found." )
6064 }
65+
66+ if ! contains (actual [0 ].Kinds , "VirtualService" ) {
67+ t .Errorf ("expected policy block to contain 'VirtualService' Kind, but was not found." )
68+ }
6169}
0 commit comments