Repository navigation
fix(policy): support xPolicies with routes referencing ListenerSet - #9243
eplightning wants to merge 2 commits into
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b17b1caea3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Was a behavior unrelated to this PR. |
b17b1ca to
fc57479
Compare
BackendTrafficPolicy and SecurityPolicy with routes referencing ListenerSetListenerSet
ListenerSetListenerSet
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc57479cdb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9243 +/- ##
==========================================
+ Coverage 75.17% 75.20% +0.02%
==========================================
Files 252 252
Lines 41049 41060 +11
==========================================
+ Hits 30860 30879 +19
+ Misses 8093 8086 -7
+ Partials 2096 2095 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ListenerSetListenerSet
3bd3d04 to
806205f
Compare
|
It seems that this PR breaks the |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 806205fda9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Name: string(p.Name), | ||
| Namespace: namespace, | ||
| Name: gwCtx.Name, | ||
| Namespace: gwCtx.Namespace, | ||
| }, | ||
| SectionName: ptr.Deref(p.SectionName, ""), |
There was a problem hiding this comment.
Record ListenerSet routes under their actual listeners
When the route parentRef is a ListenerSet without a sectionName, p.SectionName is empty even though the route is only attached to the resolved ListenerSet listeners. Storing that route under the Gateway-wide "" section makes the later overridden-status calculation treat this route policy as overriding every listener policy on the parent Gateway, including native Gateway listeners that the route never selected; the same mapping pattern is present in the EnvoyExtensionPolicy and SecurityPolicy changes. Use the resolved parentRefCtx.listeners or an LS-specific key instead of the raw parentRef section for ListenerSet parents.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I'm not sure what's the right way to do this for ListenerSets honestly, iterating over all listeners and adding all of them to the map?
There was a problem hiding this comment.
I like the approach in #9270 - it tackles this by not reusing the Gateway SectionName == "" route map for ListenerSet parents. It replaces that with an explicit policy-scope graph.
There was a problem hiding this comment.
I agree that its a much more cleaner approach.
There's a bit of overlap with this PR, and it also seems to fix the same thing - but only for the SecurityPolicy.
Should I wait for that PR to land? Or just remove the SecurityPolicy part for now to avoid overlap.
There was a problem hiding this comment.
Hi @eplightning, thanks for working on this! And sorry for the conflicting work.
To reduce the reviewer’s workload, I intentionally limited the scope of #9270 to SecurityPolicy only.
But I plan to apply the same changes to all xPolicies after merging #9270.
Would it be okay to proceed with applying this approach to all policies on my side?
There was a problem hiding this comment.
@kkk777-7 Yes that's perfectly fine with me, thank you for working on this.
806205f to
28a33ac
Compare
I couldn't reproduce locally with |
Signed-off-by: Bartosz Slawianowski <[email protected]>
28a33ac to
1aa4ff8
Compare
|
Sorry, had to rerun |
|
/retest |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea9b7d31db
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return gwapiv1.ParentReference{ | ||
| Group: GroupPtr(gwapiv1.GroupName), | ||
| Kind: KindPtr(kind), | ||
| Namespace: namespace, | ||
| Name: routeParentCtx.Name, | ||
| SectionName: routeParentCtx.SectionName, | ||
| } |
There was a problem hiding this comment.
Preserve port-scoped ListenerSet ancestors
When a route selects a ListenerSet listener with parentRefs[].port and no sectionName (like the new httproute-2 fixture), this newly-created ancestor ref drops routeParentCtx.Port, so multiple parentRefs to the same ListenerSet on different ports collapse into one PolicyAncestorStatus and any per-attachment conditions can be misattributed. Please carry the port through here (and match it when comparing ancestor refs) so port-scoped ListenerSet attachments get distinct status.
Useful? React with 👍 / 👎.
What type of PR is this?
feature
What this PR does / why we need it:
Adds support for using
BackendTrafficPolicy,EnvoyExtensionPolicyandSecurityPolicywith routes that reference aListenerSetin theirparentRefs. Currently, such policies are ignored.Which issue(s) this PR fixes:
Fixes #9242
Release Notes: Yes