[v2.3.x] apply TrafficPolicy retries per route#14304
Merged
Merged
Conversation
Move inherited retry policies onto routes so HTTPS listener translation preserves retry behavior consistently, and cover it with a golden test. Signed-off-by: omar <[email protected]>
puertomontt
force-pushed
the
retry-policy
branch
from
June 24, 2026 17:11
34f20cb to
4f46185
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts TrafficPolicy retry translation so inherited retry settings are applied at the Envoy route level (instead of the virtual host level), ensuring retry behavior is preserved consistently across translations (including HTTPS listeners), and adds golden coverage for HTTPS retry behavior.
Changes:
- Move inherited TrafficPolicy retry policy application from
VirtualHost.RetryPolicyto per-routeRouteAction.RetryPolicy. - Refactor retry application into a shared helper (
applyRetryPolicy) used by both vhost- and route-scope policy application. - Add a new HTTPS golden translator test case (
traffic-policy/https-retry.yaml) and register it inTestBasic.
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/translator/gateway/testutils/outputs/traffic-policy/timeout-retry.yaml | Updates golden output to reflect retry policy now being set at the route level (rather than the vhost level). |
| pkg/kgateway/translator/gateway/testutils/outputs/traffic-policy/https-retry.yaml | Adds a new golden output validating retry policy behavior for an HTTPS listener. |
| pkg/kgateway/translator/gateway/testutils/inputs/traffic-policy/https-retry.yaml | Adds new test input resources (HTTPS Gateway, HTTPRoute, TrafficPolicy, TLS Secret) for HTTPS retry coverage. |
| pkg/kgateway/translator/gateway/gateway_translator_test.go | Registers a new translator golden test: “TrafficPolicy HTTPS retry”. |
| pkg/kgateway/extensions2/plugins/trafficpolicy/traffic_policy_plugin.go | Applies inherited retry policy per-route and centralizes retry policy logic in applyRetryPolicy. |
Comment on lines
+387
to
+390
| if policy.spec.retry != nil { | ||
| for _, route := range out.Routes { | ||
| applyRetryPolicy(policy.spec.retry, route) | ||
| } |
davidjumani
approved these changes
Jul 9, 2026
Merged
via the queue into
kgateway-dev:v2.3.x
with commit Jul 9, 2026
599c83d
41 of 49 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
backport of #14360
Move inherited TrafficPolicy retry settings from virtual hosts onto routes so retry behavior is preserved consistently, including HTTPS listener translation.
This also adds a golden translator test covering HTTPS listener retries.
Change Type
/kind fix
Changelog