Change:
Added this test to : this resulted in: The test should pass. Add the above test No response All versions where CEL is used. All Doesn't matter No response No response No response_
There are no sig labels on this issue. Please add an appropriate label by using one of the following commands: - Please see the for a listing of the SIGs, working groups, and committees available. <detailsInstructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the label and provide further guidance. The label can be by org members by writing in a comment. <detailsInstructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/assign
Opened to discuss the expected behavior in cel-go for this.

Discussion:
"self.val1 + self.val2 == [1, 2, 3, 1, 2, 3]", "self.val1 + [4, 5] == [1, 2, 3, 4, 5]", }, <ins> errors: map[string]string{ // Mixed type lists are not allowed since we have HomogeneousAggregateLiterals enabled "[1, 'a', false].filter(x, string(x) == 'a')": "expected type 'int' but found 'string'", }, }, {name: "string lists", obj:    objs([]interface{}{"a", "b", "c"}), schema: schemas(listType(&stringType)), valid: []string{ // Join function "self.val1.join('-') == 'a-b-c'", "['a', 'b', 'c'].join('-') == 'a-b-c'", "self.val1.join() == 'abc'", "['a', 'b', 'c'].join() == 'abc'", }, </ins> }, {name: "listSets", obj:    objs([]interface{}{"a", "b", "c"}, []interface{}{"a", "c", "b"}),

"!('x' in self.val1)", "self.val1 + self.val2 == ['a', 'b', 'c']", "self.val1 + ['c', 'd'] == ['a', 'b', 'c', 'd']", <ins> // Join function "self.val1.join('-') == 'a-b-c'", "['a', 'b', 'c'].join('-') == 'a-b-c'", "self.val1.join() == 'abc'", "['a', 'b', 'c'].join() == 'abc'", </ins> }, }, {name: "listMaps",

"!('k3' in self.val1)", "self.val1 == {'k1': 'a', 'k2': 'b'}", }, <ins> errors: map[string]string{ // Mixed type maps are not allowed since we have HomogeneousAggregateLiterals enabled "{'k1': 'a', 'k2': 1, 'k2': false}": "expected type 'string' but found 'int'", }, </ins> }, {name: "objects", obj: map[string]interface{}{

"github.com/google/cel-go/common/types/ref" "github.com/google/cel-go/common/types/traits" <ins> "k8s.io/kube-openapi/pkg/validation/strfmt" </ins> "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apiserver/pkg/cel" <del> "k8s.io/kube-openapi/pkg/validation/strfmt" </del> ) // UnstructuredToVal converts a Kubernetes unstructured data element to a CEL Val.

func (t *unstructuredList) ConvertToNative(typeDesc reflect.Type) (interface{}, error) { switch typeDesc.Kind() { case reflect.Slice: <del> return t.elements, nil </del> <ins> switch t.itemsSchema.Type() { // Workaround for https://github.com/kubernetes/kubernetes/issues/117590 until we // resolve the desired behavior in cel-go via https://github.com/google/cel-go/issues/688 case "string": var result []string for _, e := range t.elements { s, ok := e.(string) if !ok { return nil, fmt.Errorf("expected all elements to be of type string, but got %T", e) } result = append(result, s) } return result, nil default: return t.elements, nil } </ins> } return nil, fmt.Errorf("type conversion error from '%s' to '%s'", t.Type(), typeDesc) }