diff --git a/pkg/policy/criteria/matchers.go b/pkg/policy/criteria/matchers.go index d0d561726..4f52ebb2b 100644 --- a/pkg/policy/criteria/matchers.go +++ b/pkg/policy/criteria/matchers.go @@ -66,7 +66,7 @@ func matchStringList(dst *ast.Body, left *ast.Term, right parser.Value) error { str, ok := right.(parser.String) if ok { right = parser.Object{ - "is": str, + "has": str, } } diff --git a/pkg/policy/criteria/matchers_test.go b/pkg/policy/criteria/matchers_test.go index 7b9b2d08e..8e65b2347 100644 --- a/pkg/policy/criteria/matchers_test.go +++ b/pkg/policy/criteria/matchers_test.go @@ -98,6 +98,6 @@ func TestStringListMatcher(t *testing.T) { var body ast.Body err := matchStringList(&body, ast.VarTerm("example"), parser.String("test")) require.NoError(t, err) - assert.Equal(t, `count(example) == 1`+"\n"+`count([true | some v; v = example[_]; v == "test"]) > 0`, str(body)) + assert.Equal(t, `count([true | some v; v = example[_]; v == "test"]) > 0`, str(body)) }) }