-
Notifications
You must be signed in to change notification settings - Fork 336
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
fix(policy): use new compute for rules and fix rules intersect #12340
Conversation
Signed-off-by: Icarus Wu <[email protected]>
Reviewer Checklist🔍 Each of these sections need to be checked by the reviewer of the PR 🔍:
|
pkg/plugins/policies/meshtrafficpermission/graph/backends/reachable_test.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Icarus Wu <[email protected]>
…code Signed-off-by: Icarus Wu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like there's a refactor/cleanup and a bug fix. Is it possible to separate both changes as it's hard to review otherwise
Signed-off-by: Icarus Wu <[email protected]>
Signed-off-by: Icarus Wu <[email protected]>
Signed-off-by: Icarus Wu <[email protected]>
b2c9c11
to
0516c46
Compare
Signed-off-by: Icarus Wu <[email protected]>
Signed-off-by: Icarus Wu <[email protected]>
Signed-off-by: Icarus Wu <[email protected]>
Signed-off-by: Icarus Wu <[email protected]>
Signed-off-by: Icarus Wu <[email protected]>
Signed-off-by: Icarus Wu <[email protected]>
Signed-off-by: Ilya Lobkov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…q#12340) ## Motivation 1. When I went through the policy matching subset `Intersect` method, I found the behavior is incorrect with one case 2. Rewrite the rule's `Compute` method to use the new `ContainsElement` method instead of using the old `IsSubset` method ## Implementation information Introduce one new type `type Element map[string]string` for differentiation by `IsSubset`. ## Supporting documentation <!-- Is there a MADR? An Issue? A related PR? --> Fix kumahq#12319 Fix kumahq#12273 <!-- > Changelog: skip --> <!-- Uncomment the above section to explicitly set a [`> Changelog:` entry here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)? --> --------- Signed-off-by: Icarus Wu <[email protected]> Signed-off-by: Ilya Lobkov <[email protected]> Co-authored-by: Ilya Lobkov <[email protected]>
…ort of kumahq#12340) 1. When I went through the policy matching subset `Intersect` method, I found the behavior is incorrect with one case 2. Rewrite the rule's `Compute` method to use the new `ContainsElement` method instead of using the old `IsSubset` method Introduce one new type `type Element map[string]string` for differentiation by `IsSubset`. <!-- Is there a MADR? An Issue? A related PR? --> Fix kumahq#12319 Fix kumahq#12273 <!-- > Changelog: skip --> <!-- Uncomment the above section to explicitly set a [`> Changelog:` entry here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)? --> --------- Signed-off-by: Icarus Wu <[email protected]> Signed-off-by: Ilya Lobkov <[email protected]> Co-authored-by: Ilya Lobkov <[email protected]>
…q#12340) 1. When I went through the policy matching subset `Intersect` method, I found the behavior is incorrect with one case 2. Rewrite the rule's `Compute` method to use the new `ContainsElement` method instead of using the old `IsSubset` method Introduce one new type `type Element map[string]string` for differentiation by `IsSubset`. <!-- Is there a MADR? An Issue? A related PR? --> Fix kumahq#12319 Fix kumahq#12273 <!-- > Changelog: skip --> <!-- Uncomment the above section to explicitly set a [`> Changelog:` entry here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)? --> --------- Signed-off-by: Icarus Wu <[email protected]> Signed-off-by: Ilya Lobkov <[email protected]> Co-authored-by: Ilya Lobkov <[email protected]>
…ort of kumahq#12340) 1. When I went through the policy matching subset `Intersect` method, I found the behavior is incorrect with one case 2. Rewrite the rule's `Compute` method to use the new `ContainsElement` method instead of using the old `IsSubset` method Introduce one new type `type Element map[string]string` for differentiation by `IsSubset`. <!-- Is there a MADR? An Issue? A related PR? --> Fix kumahq#12319 Fix kumahq#12273 <!-- > Changelog: skip --> <!-- Uncomment the above section to explicitly set a [`> Changelog:` entry here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)? --> --------- Signed-off-by: Icarus Wu <[email protected]> Signed-off-by: Ilya Lobkov <[email protected]> Co-authored-by: Ilya Lobkov <[email protected]>
…ort of kumahq#12340) 1. When I went through the policy matching subset `Intersect` method, I found the behavior is incorrect with one case 2. Rewrite the rule's `Compute` method to use the new `ContainsElement` method instead of using the old `IsSubset` method Introduce one new type `type Element map[string]string` for differentiation by `IsSubset`. <!-- Is there a MADR? An Issue? A related PR? --> Fix kumahq#12319 Fix kumahq#12273 <!-- > Changelog: skip --> <!-- Uncomment the above section to explicitly set a [`> Changelog:` entry here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)? --> --------- Signed-off-by: Icarus Wu <[email protected]> Signed-off-by: Ilya Lobkov <[email protected]> Co-authored-by: Ilya Lobkov <[email protected]>
…ort of #12340) (#12515) ## Motivation 1. When I went through the policy matching subset `Intersect` method, I found the behavior is incorrect with one case 2. Rewrite the rule's `Compute` method to use the new `ContainsElement` method instead of using the old `IsSubset` method ## Implementation information Introduce one new type `type Element map[string]string` for differentiation by `IsSubset`. <!-- > Changelog: skip --> <!-- Uncomment the above section to explicitly set a [`> Changelog:` entry here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)? --> ## Backport cherry-picked commit 3a00363 Signed-off-by: Icarus Wu <[email protected]> Signed-off-by: Ilya Lobkov <[email protected]> Co-authored-by: Ilya Lobkov <[email protected]>
…ort of #12340) (#12516) ## Motivation 1. When I went through the policy matching subset `Intersect` method, I found the behavior is incorrect with one case 2. Rewrite the rule's `Compute` method to use the new `ContainsElement` method instead of using the old `IsSubset` method ## Implementation information Introduce one new type `type Element map[string]string` for differentiation by `IsSubset`. <!-- > Changelog: skip --> <!-- Uncomment the above section to explicitly set a [`> Changelog:` entry here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)? --> ## Backport cherry-picked commit 3a00363 --------- Signed-off-by: Icarus Wu <[email protected]> Signed-off-by: Ilya Lobkov <[email protected]> Co-authored-by: Ilya Lobkov <[email protected]>
…ort of #12340) (#12517) ## Motivation 1. When I went through the policy matching subset `Intersect` method, I found the behavior is incorrect with one case 2. Rewrite the rule's `Compute` method to use the new `ContainsElement` method instead of using the old `IsSubset` method ## Implementation information Introduce one new type `type Element map[string]string` for differentiation by `IsSubset`. <!-- > Changelog: skip --> <!-- Uncomment the above section to explicitly set a [`> Changelog:` entry here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)? --> ## Backport cherry-picked commit 3a00363 --------- Signed-off-by: Icarus Wu <[email protected]> Signed-off-by: Ilya Lobkov <[email protected]> Co-authored-by: Ilya Lobkov <[email protected]>
…ort of #12340) (#12518) ## Motivation 1. When I went through the policy matching subset `Intersect` method, I found the behavior is incorrect with one case 2. Rewrite the rule's `Compute` method to use the new `ContainsElement` method instead of using the old `IsSubset` method ## Implementation information Introduce one new type `type Element map[string]string` for differentiation by `IsSubset`. <!-- > Changelog: skip --> <!-- Uncomment the above section to explicitly set a [`> Changelog:` entry here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)? --> ## Backport cherry-picked commit 3a00363 --------- Signed-off-by: Icarus Wu <[email protected]> Signed-off-by: Ilya Lobkov <[email protected]> Co-authored-by: Ilya Lobkov <[email protected]>
Motivation
Intersect
method, I found the behavior is incorrect with one caseCompute
method to use the newContainsElement
method instead of using the oldIsSubset
methodImplementation information
Introduce one new type
type Element map[string]string
for differentiation byIsSubset
.Supporting documentation
Fix #12319
Fix #12273