Skip to content

feat: support listenerset policy attach in backend traffic policy - #9419

Merged
kkk777-7 merged 6 commits into
envoyproxy:mainfrom
kkk777-7:feat-btp-ls-attach
Jul 30, 2026
Merged

feat: support listenerset policy attach in backend traffic policy#9419
kkk777-7 merged 6 commits into
envoyproxy:mainfrom
kkk777-7:feat-btp-ls-attach

Conversation

@kkk777-7

@kkk777-7 kkk777-7 commented Jul 5, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it:

follow-up #9270

Support policy attachment for ListenerSet.

This PR includes:

  • Policy attachment to ListenerSet and ListenerSet sections
  • Route policy attachment when a route has a ListenerSet parent
  • Route override/merge logic that accounts for ListenerSet scopes

currently, don't support mergeType for ListenerSet. only support for xRoute.

Which issue(s) this PR fixes:

Fixes #8092

@netlify

netlify Bot commented Jul 5, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit cd0fcb9
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a69a866f730660008c84bec
😎 Deploy Preview https://deploy-preview-9419--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kkk777-7
kkk777-7 force-pushed the feat-btp-ls-attach branch from c88a804 to 148b54d Compare July 5, 2026 08:18
@kkk777-7 kkk777-7 changed the title Feat btp ls attach feat: support listenerset policy attach in backend traffic policy Jul 5, 2026
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.22989% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.76%. Comparing base (511b1e8) to head (cd0fcb9).

Files with missing lines Patch % Lines
internal/gatewayapi/backendtrafficpolicy.go 89.94% 19 Missing and 15 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9419      +/-   ##
==========================================
+ Coverage   75.73%   75.76%   +0.02%     
==========================================
  Files         254      254              
  Lines       42110    42316     +206     
==========================================
+ Hits        31892    32060     +168     
- Misses       8073     8100      +27     
- Partials     2145     2156      +11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kkk777-7
kkk777-7 marked this pull request as ready for review July 5, 2026 15:15
@kkk777-7
kkk777-7 requested a review from a team as a code owner July 5, 2026 15:15
@kkk777-7

kkk777-7 commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c079decd74

ℹ️ 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".

Comment on lines 1904 to +1905
parentRef.SectionName,
listenerSetNN,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve section routing for all-listener ListenerSet refs

When a Route parentRef targets a ListenerSet without sectionName (valid and used to attach to every compatible ListenerSet listener), this call sets listenerSetNN but still passes parentRef.SectionName, which is nil. LookupBTPRoutingType only checks listenerSetListenerLevel when a listener name is present, so a BackendTrafficPolicy targeting one ListenerSet section is ignored for these routes and they fall back to the ListenerSet/Gateway routingType instead of the listener-specific policy.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch, I think this issue existed before this PR.
the underlying limitation is the same as the existing Gateway all-listener parentRef behavior: processDestination only has parentRef.SectionName, so section-specific RoutingType is not resolved when the Route parentRef omits sectionName.

we may need to refactor processDestination to contain listener information.
This change is big, so if we fix this issue I prefer to handle this in follow-up PR.

zhaohuabing
zhaohuabing previously approved these changes Jul 25, 2026

@zhaohuabing zhaohuabing left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks!

@zhaohuabing
zhaohuabing requested a review from a team July 25, 2026 08:51
kkk777-7 added 4 commits July 29, 2026 11:19
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
@zirain
zirain force-pushed the feat-btp-ls-attach branch from c079dec to 9e5019d Compare July 29, 2026 03:19
zirain
zirain previously approved these changes Jul 29, 2026
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
@kkk777-7
kkk777-7 dismissed stale reviews from zirain and zhaohuabing via 3758d63 July 29, 2026 05:52
zhaohuabing
zhaohuabing previously approved these changes Jul 29, 2026
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
@kkk777-7

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd0fcb971a

ℹ️ 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".

Comment thread internal/gatewayapi/route.go
@kkk777-7
kkk777-7 merged commit 7c3e11b into envoyproxy:main Jul 30, 2026
138 of 151 checks passed
HusseinKabbout pushed a commit to HusseinKabbout/gateway that referenced this pull request Jul 30, 2026
…voyproxy#9419)

* feat: backend traffic policy listenerset attach

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

* add release note

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

* update docs

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

* fix e2e testfile

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

* update latest code

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

---------

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ListenerSet as TargetRefs for xPolicies

4 participants