Skip to content

Conversation

@Aditya7880900936
Copy link
Contributor

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

  • Ensures the dummy EmptyCluster TCPRoute is shared instead of recreated per listener
  • Prevents duplicate EmptyCluster routes in the generated Envoy config
  • Keeps existing behavior unchanged for single-listener cases

Tests

  • Added a standalone regression test to verify Envoy Gateway starts successfully
    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

@Aditya7880900936 Aditya7880900936 requested a review from a team as a code owner January 10, 2026 12:30
@netlify
Copy link

netlify bot commented Jan 10, 2026

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 378b464
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/696e4e853b850c0008b8930e
😎 Deploy Preview https://deploy-preview-7912--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.

@codecov
Copy link

codecov bot commented Jan 10, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.86%. Comparing base (2d5eced) to head (378b464).
⚠️ Report is 100 commits behind head on main.

Files with missing lines Patch % Lines
internal/xds/translator/translator.go 50.00% 1 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (50.00%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7912      +/-   ##
==========================================
+ Coverage   72.36%   72.86%   +0.49%     
==========================================
  Files         234      237       +3     
  Lines       34566    35538     +972     
==========================================
+ Hits        25014    25895     +881     
- Misses       7761     7802      +41     
- Partials     1791     1841      +50     

☔ 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.

@arkodg
Copy link
Contributor

arkodg commented Jan 10, 2026

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

@Aditya7880900936
Copy link
Contributor Author

Thanks for the suggestion @arkodg ,
I’ve removed the standalone test and added a translator test case under internal/xds/translator/testdata that reproduces the issue with multiple TCP listeners without routes and validates that only a single EmptyCluster is generated.
All translator tests are passing now — please let me know if you’d like any adjustments.

@arkodg
Copy link
Contributor

arkodg commented Jan 14, 2026

can you revert the standalone test file and leave it as is

@Aditya7880900936
Copy link
Contributor Author

Hi @arkodg ,
Got it, thanks for clarifying!
I’ve reverted the standalone test back to its original state and left it unchanged, and the translator regression test remains in place.
Please let me know if this looks good now.

@arkodg
Copy link
Contributor

arkodg commented Jan 14, 2026

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.

@Aditya7880900936 Aditya7880900936 force-pushed the fix/tcp-emptycluster-duplicate branch 3 times, most recently from aeed89b to 407f10a Compare January 15, 2026 06:37
@Aditya7880900936
Copy link
Contributor Author

Hi @arkodg,

Thanks for the feedback. I’ve cleaned up the diff and removed the unrelated dependabot change.
The PR now only includes the translator fix and a regression test under
internal/xds/translator/testdata that reproduces the issue.

I’ve re-verified the behavior locally and all translator tests are passing.
Please let me know if this now aligns with the requested changes.

@Aditya7880900936 Aditya7880900936 force-pushed the fix/tcp-emptycluster-duplicate branch from 407f10a to d6a9025 Compare January 19, 2026 05:25
…outes

Signed-off-by: Aditya7880900936 <adityasanskarsrivastav788@gmail.com>
@Aditya7880900936 Aditya7880900936 force-pushed the fix/tcp-emptycluster-duplicate branch from d6a9025 to 378b464 Compare January 19, 2026 15:32
@Aditya7880900936
Copy link
Contributor Author

Hi @arkodg,

I fixed the test compilation issue and re-ran the translator tests locally.
TestTranslateXds is now passing, and the change only affects the translator
logic and its regression test.

I’ve force-pushed the updated commit — please let me know if anything else
needs adjustment.

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.

Gateway generates invalid Envoy config with multiple EmptyCluster Routes

2 participants