Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(operators): supporting subset checking #1613

Merged
merged 9 commits into from
Feb 26, 2021
Merged

feat(operators): supporting subset checking #1613

merged 9 commits into from
Feb 26, 2021

Conversation

RinkiyaKeDad
Copy link
Contributor

@RinkiyaKeDad RinkiyaKeDad commented Feb 17, 2021

Signed-off-by: Arsh Sharma arshsharma461@gmail.com

Fixes #1367

What type of PR is this

/kind bug

Checklist

  • I have read the contributing guidelines.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added or changed the documentation. -> Should I explain using a sample policy too in the documentation for more clarity?

Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
@RinkiyaKeDad RinkiyaKeDad marked this pull request as ready for review February 24, 2021 08:46
@RinkiyaKeDad
Copy link
Contributor Author

RinkiyaKeDad commented Feb 24, 2021

For subset definition reference check this.

Given 2 sets, S1 and S2:

  • S1 In S2: means all values of S1 are in S2
  • S1 NotIn S2: means none of the values of S1 are in S2

UPDATE: S1 NotIn S2: means any one of the values of S1 is not in S2

@RinkiyaKeDad RinkiyaKeDad changed the title [WIP] fix(operators): supporting subset checking feat(operators): supporting subset checking Feb 24, 2021
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
Copy link
Member

@realshuting realshuting left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

It would be good to add an additional test, see comments.

@@ -1013,3 +1013,105 @@ func Test_Eval_Equal_Var_Fail(t *testing.T) {
t.Error("expected to fail")
}
}

// subset test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add another test -

key: [1.1.1.1, 4.4.4.4]
op: NotIn
value: [1.1.1.1, 2.2.2.2, 3.3.3.3]

@realshuting
Copy link
Member

For subset definition reference check this.

Given 2 sets, S1 and S2:

  • S1 In S2: means all values of S1 are in S2
  • S1 NotIn S2: means none of the values of S1 are in S2

@RinkiyaKeDad This is no longer the case, can you update it?

We need to log an issue to track the doc updates in kyverno/website.

Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
@RinkiyaKeDad
Copy link
Contributor Author

For subset definition reference check this.

Given 2 sets, S1 and S2:

  • S1 In S2: means all values of S1 are in S2
  • S1 NotIn S2: means none of the values of S1 are in S2

@RinkiyaKeDad This is no longer the case, can you update it?

We need to log an issue to track the doc updates in kyverno/website.

@realshuting - updated the test and the definition. I have already opened a PR for the docs on the website repo. Please take a look at that.

@realshuting realshuting merged commit 86879bd into kyverno:main Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support set operations for In and NotIn
2 participants