Skip to content

fix: rename listener using its address and port #6544

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

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

zhaohuabing
Copy link
Member

@zhaohuabing zhaohuabing commented Jul 17, 2025

Currently, the xDS listener is named after one of the owning Gateway Listeners. When multiple Gateway Listeners are configured listening on the same port, the generated xDS listener name is derived from a randomly selected Gateway Listener. This can cause unnecessary listener drains in Envoy if one of the Gateway Listeners is deleted or a new one is created using the same port.

This PR resolves the issue by naming the xDS listener based on its listening address and port, ensuring consistent naming even when multiple Gateways share the same port.

Notice: xDS listener is a de-fact API surface - it's used by EnvoyPatchPolicy and ExtensionManager to modify xDS resources, and users may rely on it for configuring metrics or monitoring. To avoid introducing breaking change in v1.5 ,this change is gated by the UseAddressAsListenerName feature flag. This flag is disabled by default in v1.5, and it will be enabled in v1.6.

This PR also:

  • Changes the UDP listener name to follow the same naming patter as TCP.
  • Adds Gateway Resource to the Listener metadata, so the ExtensionManager can use them as a replacement of the previous listener name if the Gateway and Listener resource names are required in its mutation processing.

fix: #6534
release-note: yes

@zhaohuabing zhaohuabing requested a review from a team as a code owner July 17, 2025 09:02
@zhaohuabing zhaohuabing marked this pull request as draft July 17, 2025 09:02
Copy link

codecov bot commented Jul 17, 2025

Codecov Report

Attention: Patch coverage is 56.75676% with 16 lines in your changes missing coverage. Please review.

Project coverage is 70.78%. Comparing base (9b91cd1) to head (117a25f).

Files with missing lines Patch % Lines
api/v1alpha1/envoygateway_helpers.go 28.57% 9 Missing and 1 partial ⚠️
internal/xds/translator/listener.go 75.00% 2 Missing and 1 partial ⚠️
internal/xds/translator/metadata.go 66.66% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6544      +/-   ##
==========================================
+ Coverage   70.77%   70.78%   +0.01%     
==========================================
  Files         224      224              
  Lines       38614    38672      +58     
==========================================
+ Hits        27328    27375      +47     
- Misses       9695     9703       +8     
- Partials     1591     1594       +3     

☔ View full report in Codecov by Sentry.
📢 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.

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing
Copy link
Member Author

/retest

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.

Unexpected listener draining upon gateway deletion on mergeGateways mode
1 participant