Skip to content

[v2.3.x] apply TrafficPolicy retries per route#14304

Merged
davidjumani merged 1 commit into
kgateway-dev:v2.3.xfrom
puertomontt:retry-policy
Jul 9, 2026
Merged

[v2.3.x] apply TrafficPolicy retries per route#14304
davidjumani merged 1 commit into
kgateway-dev:v2.3.xfrom
puertomontt:retry-policy

Conversation

@puertomontt

@puertomontt puertomontt commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

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

Fixed TrafficPolicy retry translation for HTTPS listeners by applying retry policy at route level.

Copilot AI review requested due to automatic review settings June 24, 2026 17:10
@puertomontt
puertomontt requested a review from a team as a code owner June 24, 2026 17:10
@puertomontt
puertomontt changed the base branch from main to v2.3.x June 24, 2026 17:10
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]>

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 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.RetryPolicy to per-route RouteAction.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 in TestBasic.

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)
}
@puertomontt puertomontt added the work in progress Indicates that a PR should not merge because it is a work in progress label Jun 24, 2026
@puertomontt puertomontt changed the title fix: apply TrafficPolicy retries per route apply TrafficPolicy retries per route Jul 1, 2026
@puertomontt puertomontt added kind/fix Categorizes issue or PR as related to a bug. and removed kind/fix Categorizes issue or PR as related to a bug. work in progress Indicates that a PR should not merge because it is a work in progress labels Jul 7, 2026
@puertomontt puertomontt changed the title apply TrafficPolicy retries per route [v2.3.x] apply TrafficPolicy retries per route Jul 7, 2026
@davidjumani
davidjumani added this pull request to the merge queue Jul 9, 2026
Merged via the queue into kgateway-dev:v2.3.x with commit 599c83d Jul 9, 2026
41 of 49 checks passed
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