Repository navigation
fix(tcp): avoid duplicate EmptyCluster routes for listeners without routes - #7912
Aditya7880900936 wants to merge 6 commits into
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7912 +/- ##
==========================================
+ Coverage 72.36% 73.59% +1.22%
==========================================
Files 234 242 +8
Lines 34566 37023 +2457
==========================================
+ Hits 25014 27247 +2233
- Misses 7761 7855 +94
- Partials 1791 1921 +130 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
thanks @Aditya7880900936 , instead of the standalone test, can you rm that and add a test case in https://github.com/envoyproxy/gateway/tree/main/internal/xds/translator/testdata that mimics the issue |
|
Thanks for the suggestion @arkodg , |
|
can you revert the standalone test file and leave it as is |
|
Hi @arkodg , |
|
The new diff still doesn’t implement the requested changes and introduces the same issues as before. We’ve already provided detailed guidance, so further updates need to be reviewed carefully before being pushed. Please do not submit another diff until you have verified that it actually addresses each review comment. |
aeed89b to
407f10a
Compare
|
Hi @arkodg, Thanks for the feedback. I’ve cleaned up the diff and removed the unrelated dependabot change. I’ve re-verified the behavior locally and all translator tests are passing. |
d6a9025 to
378b464
Compare
|
Hi @arkodg, I fixed the test compilation issue and re-ran the translator tests locally. I’ve force-pushed the updated commit — please let me know if anything else |
…outes Signed-off-by: Aditya7880900936 <[email protected]>
378b464 to
5b04f76
Compare
…n no routes exist Signed-off-by: Aditya7880900936 <[email protected]>
|
Hi @arkodg @sudiptob2 , I have updated the code , have a look and feel free to have any suggestions |
|
Please fix the lint issues first. |
Signed-off-by: Aditya7880900936 <[email protected]>
Signed-off-by: Aditya7880900936 <[email protected]>
…ners Signed-off-by: Aditya7880900936 <[email protected]>
Signed-off-by: Aditya7880900936 <[email protected]>
|
Hi @sudiptob2 , i implemented the changes you suggested earlier , gen check and lints are passed successfully , feel free to have a review on this PR |
|
friendly ping @sudiptob2 @arkodg , have a look on this PR , i applied all of your suggested changes |
|
Hey, thanks for working on this. However, it still seems to me that the current fix does not solve the issue. Envoy's duplicate filter chain detection is based on matching rules ( See the following code blocks for reference: gateway/internal/xds/translator/listener.go Line 620 in 106dba3 gateway/internal/xds/translator/listener.go Lines 674 to 676 in 106dba3 Therefore, they all end up with identical empty matchers |
|
👋 I've opened #8521 to complete this work. Our company urgently needed this fix due to production issues, and since this PR has been inactive for 2 weeks, I extended the implementation to properly handle SNI-based filter chain matching as noted in the review comments by @sudiptob2. Credit to @Aditya7880900936 for the original work on unique cluster naming. I've built on that foundation and added:
The fix has been tested locally with Kind cluster and all unit tests pass. Envoy now accepts the configuration without duplicate matcher errors. Happy to collaborate or defer if you're planning to continue this work! |
…ty routes This fix addresses the issue where multiple TLS passthrough listeners on the same port without routes would generate duplicate empty filter chains without unique matching rules, causing Envoy to reject the configuration with: "filter chain 'EmptyCluster' has the same matching rules defined as 'EmptyCluster'" Changes: - Add Hostnames field to TCPListener IR to capture SNI values from Gateway API - Populate hostnames from Gateway API listener.Hostname for TLS protocol - Detect TLS passthrough by presence of hostnames (SNI matching required) - Create unique EmptyCluster per TLS passthrough listener with SNI-based matching - Add TLSInspectorConfig with SNIs to enable filterChainMatch generation - Add test coverage for multiple TLS passthrough listeners without routes This ensures each TLS passthrough listener gets a unique filter chain with serverNames matching, allowing Envoy to properly route based on SNI. Builds on work from envoyproxy#7912 by @Aditya7880900936 which addressed the unique cluster naming issue. This PR extends it to properly implement SNI-based filter chain matching as noted in the review comments by @sudiptob2. Fixes envoyproxy#7912 Signed-off-by: Oliver Bailey <[email protected]>
This PR fixes an issue where Envoy Gateway generated invalid Envoy configuration
when multiple TCP/TLS passthrough listeners had no attached routes.
In such cases, the translator was creating identical dummy EmptyCluster routes
per listener, which resulted in duplicate routes and Envoy rejecting the config.
What this PR does
Tests
with multiple TCP/TLS passthrough listeners that have no attached routes
Why this is needed
This scenario is valid per Gateway API, but previously caused Envoy startup
failures due to duplicate dummy routes.
Fixes #7866