fix(gatewayapi): isolate nested wildcard listeners on a shared port - #9947
Open
omkar619-dev wants to merge 1 commit into
Open
fix(gatewayapi): isolate nested wildcard listeners on a shared port#9947omkar619-dev wants to merge 1 commit into
omkar619-dev wants to merge 1 commit 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: 64380e2b81
ℹ️ 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".
Signed-off-by: Omkar Shendge <omkarshendge619@gmail.com>
omkar619-dev
force-pushed
the
fix/nested-wildcard-listener-isolation
branch
from
September 4, 2026 06:31
64380e2 to
1eb791a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
A route with a concrete hostname attaches to a less specific wildcard listener even when a nested wildcard listener on the same port already owns that hostname, so both listeners serve the route.
The filter at the end of computeHosts removed a sibling listener's hostname from the route's matched set as a literal string:
hostnamesSet.Delete(string(*listener.Hostname))
That only deletes something when the set happens to hold that exact string. The match phase resolves the set to whatever the route asked for, so with a sibling
*.dev.example.comand a route hostnametest.dev.example.comthe set holds the concrete name, the delete matches nothing, and the apex*.example.comlistener keeps a host it does not own. That is at odds with the function's own doc comment, which says it returns hostnames "that don't intersect with other listener hostnames".This replaces the literal delete with a specificity comparison: a sibling removes any matched hostname it matches at least as specifically as the listener being computed. Specificity ranks an exact hostname above any wildcard, a longer wildcard suffix above a shorter one, and an empty listener hostname - which matches everything - below both.
Behaviour for existing configurations is unchanged: an exact sibling outranks any wildcard and still deletes, exactly as the literal delete did.
Notes for reviewers:
>=, not>. Equal specificity means an identical hostname, and only the loser of that conflict reaches this loop with the winner as its sibling, because the hostnameConflictLoser guard skips the other direction - so the two can never delete each other's hosts. A strict>regresses TestComputeHostsConflictOwnership.remainingis empty and it requires len(remaining) > 0.The failure is invisible in status: every listener stays Programmed: True, the correct certificate is served on the HTTPS variant, and nothing is logged though, so the only reliable detection is comparing each listener's rds.route_config_name against the names actually present in RoutesConfigDump.
It was reported by @steache, who confirmed across five clusters that the discriminator is the route hostname rather than the Envoy Gateway version; and also @TheisFerre confirmed the guard added in #9768 is a no-op for this shape.
Which issue(s) this PR fixes:
Fixes #9895