Skip to content

Logical operation against array functions not working as expected in v1.16 #624

Closed
@rassakhatsky

Description

@rassakhatsky

Affected version: 1.16+ (v1.15 works fine).
I'm getting a strange issue while trying to use logical operation against array functions. v1.16 has this issue, v1.15 works fine.
Here is a simple snippet:

	type tag struct {
		Name string
	}

	type item struct {
		Tags []tag
	}

	i := item{
		Tags: []tag{
			{Name: "one"},
			{Name: "two"},
		},
	}

	rule := `[
true && true, 
one(Tags, .Name in ["one"]), 
one(Tags, .Name in ["two"]), 
one(Tags, .Name in ["one"]) && one(Tags, .Name in ["two"])
]`
	resp, err := expr.Eval(rule, i)

Expected Result in v1.15: [true, true, true, true].
Actual Result in v1.16: [true, true, true, false].

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions