[Gateway source controllers]: Fix cross-listener SAN pollution when gateway has multiple HTTPS listeners#728
Merged
Conversation
Member
Author
|
/cc @marc1404 |
8c0655e to
34608ba
Compare
Member
Author
|
/test pull-cert-management-integration |
Member
Author
|
/cc @marc1404 |
marc1404
reviewed
May 19, 2026
Member
marc1404
left a comment
There was a problem hiding this comment.
Thank you for fixing the SAN pollution issue in both codelines!
Two smaller comments below.
… and MatchesWildcardAnySubdomain; go mod tidy
marc1404
reviewed
May 19, 2026
Member
marc1404
left a comment
There was a problem hiding this comment.
Thanks for addressing my feedback! 🙏
/cla
/lgtm
/approve
|
Successfully reached out to cla-assistant.io to initialize recheck of PR #728 |
|
LGTM label has been added. DetailsGit tree hash: b7b59931e0fe833b92ed26bd0bd2a2085b1df3bb |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: marc1404 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
How to categorize this PR?
/kind bug
What this PR does / why we need it:
Two commits fixing cross-listener SAN pollution in gateway source controllers described in issue Gateway API: Cross-listener SAN pollution when Gateway has multiple HTTPS listeners #727.
The fix introduces three shared helpers (MatchesWildcardSingleSubdomain, MatchesWildcardAnySubdomain, IsWildcard) and skips foreign hosts when the listener/server has a foreign wildcard pattern. Touches both the legacy controller (pkg/controller/source/gateways/...) and the next-generation certman2 controller.
Which issue(s) this PR fixes:
Fixes #727
Special notes for your reviewer:
The method
MatchesWildcardSingleSubdomainwas copied from the external-dns-management repo. Unfortunately, using it directly resulted in new dependencies to provider specific packages. Therefore this approach was reverted.There is one edge test case, which now returns different results:
With listener host
b.example.comand http routes tofoo.example.comandbar.example.com, the certificate only containsb.example.com, as non-matching http routes should be ignored according to the API spec.Release note: