[2.3] fix backend health check host on static backends#14290
Merged
puertomontt merged 2 commits intoJun 23, 2026
Conversation
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]>
puertomontt
force-pushed
the
cherry-pick-717f794-v2.3.x
branch
from
June 23, 2026 15:13
2b81ea6 to
ff54a74
Compare
Contributor
There was a problem hiding this comment.
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
enabled auto-merge
June 23, 2026 15:17
sheidkamp
approved these changes
Jun 23, 2026
sheidkamp
left a comment
Contributor
There was a problem hiding this comment.
difference in line count is from metadata: {} appearing in golden file output in this branch
Merged
via the queue into
kgateway-dev:v2.3.x
with commit Jun 23, 2026
5b1e6fd
31 of 34 checks passed
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
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
Additional Notes
Verification:
go test -tags e2e ./pkg/kgateway/extensions2/plugins/backendconfigpolicygo test -tags e2e ./pkg/kgateway/translator/gateway -run '^TestBasic$/^Backend_Config_Policy_with_Health_Check_on_Static_Backend$'