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

targetRef matching API improvements #8681

Open
slonka opened this issue Dec 19, 2023 · 6 comments
Open

targetRef matching API improvements #8681

slonka opened this issue Dec 19, 2023 · 6 comments
Labels
kind/improvement Improvement on an existing feature triage/accepted The issue was reviewed and is complete enough to start working on it triage/stale Inactive for some time. It will be triaged again

Comments

@slonka
Copy link
Contributor

slonka commented Dec 19, 2023

Description

It's not always clear how to call functions like MatchedPolicies and what to do with the results without digging into implementation. For single item rules sometimes we call .Compute on it like here

rule := policies.SingleItemRules.Rules.Compute(core_xds.MeshSubset())
(and why is MeshSubset hardcoded not taken from targetRef?) and sometimes we just get the Rules[0]
rawConf := rules.Rules[0].Conf
conf := rawConf.(api.Conf)
- which one is correct? what about From/To rules?

The algorithm is nicely documented on the website https://kuma.io/docs/2.5.x/policies/targetref/#understanding-targetref-policies but I think we could do a better job explaining in code what's what and how to use it.

Tagging @lobkovilya because he probably knows best.

@slonka slonka added triage/pending This issue will be looked at on the next triage meeting kind/feature New feature labels Dec 19, 2023
@jakubdyszkiewicz jakubdyszkiewicz added triage/accepted The issue was reviewed and is complete enough to start working on it kind/improvement Improvement on an existing feature and removed triage/pending This issue will be looked at on the next triage meeting kind/feature New feature labels Jan 2, 2024
@michaelbeaumont
Copy link
Contributor

Maybe we can structure the types such that you can't use both

@jakubdyszkiewicz
Copy link
Contributor

xref #8155

Triage: both ways are correct. We could unify those occurrences of the code.
Also consider documenting .Compute function.

@github-actions github-actions bot added the triage/stale Inactive for some time. It will be triaged again label Apr 2, 2024
Copy link
Contributor

github-actions bot commented Apr 2, 2024

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed.
If you think this issue is still relevant, please comment on it or attend the next triage meeting.

@slonka slonka removed the triage/stale Inactive for some time. It will be triaged again label Apr 2, 2024
@github-actions github-actions bot added the triage/stale Inactive for some time. It will be triaged again label Jul 3, 2024
Copy link
Contributor

github-actions bot commented Jul 3, 2024

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed.
If you think this issue is still relevant, please comment on it or attend the next triage meeting.

@Automaat Automaat removed the triage/stale Inactive for some time. It will be triaged again label Jul 5, 2024
@github-actions github-actions bot added the triage/stale Inactive for some time. It will be triaged again label Oct 4, 2024
Copy link
Contributor

github-actions bot commented Oct 4, 2024

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed.
If you think this issue is still relevant, please comment on it or attend the next triage meeting.

@slonka slonka removed the triage/stale Inactive for some time. It will be triaged again label Oct 7, 2024
@github-actions github-actions bot added the triage/stale Inactive for some time. It will be triaged again label Jan 6, 2025
Copy link
Contributor

github-actions bot commented Jan 6, 2025

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed.
If you think this issue is still relevant, please comment on it or attend the next triage meeting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement Improvement on an existing feature triage/accepted The issue was reviewed and is complete enough to start working on it triage/stale Inactive for some time. It will be triaged again
Projects
None yet
Development

No branches or pull requests

4 participants