[2.3.x] Fix: Hostname/ServiceEntry with multi-port hosts (#14212)#14259
Merged
Conversation
… multi-port hosts (kgateway-dev#14212) Signed-off-by: Yossi Mesika <[email protected]> Signed-off-by: Yossi Mesika <[email protected]> Co-authored-by: Omar Hammami <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Backport of #14212 to fix incorrect backend resolution when an HTTPRoute uses kind: Hostname / kind: ServiceEntry with an explicit port against a multi-port ServiceEntry sharing the same host.
Changes:
- Implement
backendKey.String()to include the port, preventing KRT index key collisions across ports. - Add a regression golden test fixture for a multi-port
ServiceEntry+HostnamebackendRef withport: 80. - Add expected xDS output verifying the route selects the
..._80cluster (not..._443).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/krtcollections/policy.go | Ensures backend alias index keys include port in their string form to avoid multi-port collisions. |
| pkg/kgateway/setup/testdata/serviceentry/dr/se-hostname-ref-multiport.yaml | Adds a repro fixture for multi-port ServiceEntry with Hostname backendRef targeting a specific port. |
| pkg/kgateway/setup/testdata/serviceentry/dr/se-hostname-ref-multiport-out.yaml | Golden output asserting the generated route targets the requested port’s cluster. |
Signed-off-by: Yossi Mesika <[email protected]>
alexliu541
approved these changes
Jun 16, 2026
andy-fong
approved these changes
Jun 16, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jun 16, 2026
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.
Description
Backport #14212
Change Type
/kind fix
Changelog
Additional Notes