Skip to content

[2.3.x] Fix: Hostname/ServiceEntry with multi-port hosts (#14212)#14259

Merged
ymesika merged 2 commits into
kgateway-dev:v2.3.xfrom
ymesika:backport-14212
Jun 16, 2026
Merged

[2.3.x] Fix: Hostname/ServiceEntry with multi-port hosts (#14212)#14259
ymesika merged 2 commits into
kgateway-dev:v2.3.xfrom
ymesika:backport-14212

Conversation

@ymesika

@ymesika ymesika commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Description

Backport #14212

Change Type

/kind fix

Changelog

Fixed route Hostname/ServiceEntry backendRefs to the requested port on multi-port hosts

Additional Notes

… 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]>
Copilot AI review requested due to automatic review settings June 16, 2026 06:27
@gateway-bot gateway-bot added kind/fix Categorizes issue or PR as related to a bug. release-note labels Jun 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 + Hostname backendRef with port: 80.
  • Add expected xDS output verifying the route selects the ..._80 cluster (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]>
@davidjumani
davidjumani added this pull request to the merge queue Jun 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 16, 2026
@ymesika
ymesika added this pull request to the merge queue Jun 16, 2026
Merged via the queue into kgateway-dev:v2.3.x with commit ae63baa Jun 16, 2026
31 checks passed
@ymesika
ymesika deleted the backport-14212 branch June 16, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/fix Categorizes issue or PR as related to a bug. release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants