Skip to content

[2.3] fix backend health check host on static backends#14290

Merged
puertomontt merged 2 commits into
kgateway-dev:v2.3.xfrom
puertomontt:cherry-pick-717f794-v2.3.x
Jun 23, 2026
Merged

[2.3] fix backend health check host on static backends#14290
puertomontt merged 2 commits into
kgateway-dev:v2.3.xfrom
puertomontt:cherry-pick-717f794-v2.3.x

Conversation

@puertomontt

@puertomontt puertomontt commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Description

Backports #14201 / commit 717f794 to v2.3.x.

This honors explicit BackendConfigPolicy HTTP health check hosts and gRPC authorities for static backends by clearing the per-endpoint health check hostname override that static backend endpoints stamp by default.

Change Type

/kind fix

Changelog

Fixed BackendConfigPolicy health check host and gRPC authority overrides for static backends.

Additional Notes

Verification:

  • go test -tags e2e ./pkg/kgateway/extensions2/plugins/backendconfigpolicy
  • go test -tags e2e ./pkg/kgateway/translator/gateway -run '^TestBasic$/^Backend_Config_Policy_with_Health_Check_on_Static_Backend$'

Copilot AI review requested due to automatic review settings June 23, 2026 15:12
@gateway-bot gateway-bot added do-not-merge/description-invalid kind/fix Categorizes issue or PR as related to a bug. release-note labels Jun 23, 2026
Adapt the cherry-picked static backend health check coverage to the v2.3.x translator test harness and golden output shape.

Signed-off-by: omar <[email protected]>

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

This PR backports a fix to ensure BackendConfigPolicy health check host (HTTP host / gRPC authority) is honored for Static backends by removing the per-endpoint health_check_config.hostname override that would otherwise take precedence over the cluster-level configuration.

Changes:

  • Clear per-endpoint health check hostname overrides when a policy explicitly sets an HTTP host or gRPC authority.
  • Add unit tests covering HTTP host override, gRPC authority override, and default behavior when no host is configured.
  • Add a gateway translator golden test case for a static DNS backend with BackendConfigPolicy.healthCheck.http.host.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/kgateway/extensions2/plugins/backendconfigpolicy/plugin.go Clears per-endpoint health check hostname overrides when an explicit health check host/authority is configured.
pkg/kgateway/extensions2/plugins/backendconfigpolicy/plugin_test.go Adds unit tests verifying endpoint hostname override clearing behavior for HTTP and gRPC health checks.
pkg/kgateway/translator/gateway/gateway_translator_test.go Registers a new golden test case covering the static-backend health check host scenario.
pkg/kgateway/translator/gateway/testutils/inputs/backendconfigpolicy/healthcheck-static-backend.yaml New input manifest reproducing the static-backend + explicit health check host scenario.
pkg/kgateway/translator/gateway/testutils/outputs/backendconfigpolicy/healthcheck-static-backend.yaml New expected output verifying the endpoint-level override is removed and cluster-level host is used.

Comment on lines +263 to +267
// health_check_config.hostname with the backend's dial address. Per Envoy
// semantics that endpoint-level hostname overrides the cluster-level
// http_health_check host (and gRPC authority). When the BackendConfigPolicy
// explicitly configures a health check host, honor it by clearing the
// auto-stamped endpoint hostname so the configured value is used.
@puertomontt
puertomontt enabled auto-merge June 23, 2026 15:17

@sheidkamp sheidkamp 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.

difference in line count is from metadata: {} appearing in golden file output in this branch

@puertomontt
puertomontt added this pull request to the merge queue Jun 23, 2026
Merged via the queue into kgateway-dev:v2.3.x with commit 5b1e6fd Jun 23, 2026
31 of 34 checks passed
@puertomontt
puertomontt deleted the cherry-pick-717f794-v2.3.x branch June 23, 2026 15:55
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.

4 participants