Skip to content

[v2.2.x] apply TrafficPolicy retries per route (#14304)#14392

Merged
davidjumani merged 1 commit into
kgateway-dev:v2.2.xfrom
puertomontt:cherry-pick-14304-v2.2.x
Jul 13, 2026
Merged

[v2.2.x] apply TrafficPolicy retries per route (#14304)#14392
davidjumani merged 1 commit into
kgateway-dev:v2.2.xfrom
puertomontt:cherry-pick-14304-v2.2.x

Conversation

@puertomontt

Copy link
Copy Markdown
Contributor

Description

Backport of #14304 (originally backported from #14360) to the v2.2.x branch.

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.

Additional Notes

Clean cherry-pick of 599c83d apart from one conflict in gateway_translator_test.go: the source commit's diff context included a pre-existing grpcroute-timeout test that does not exist on v2.2.x, so only the new TrafficPolicy HTTPS retry test case was applied. The https-retry.yaml golden output was regenerated on v2.2.x (REFRESH_GOLDEN=true); the only differences from the source golden are pre-existing branch differences in Gateway status (AttachedListenerSets condition, no GRPCRoute supported kind) — the Envoy retry config is identical.

Copilot AI review requested due to automatic review settings July 13, 2026 14:40
@gateway-bot gateway-bot added kind/fix Categorizes issue or PR as related to a bug. release-note labels Jul 13, 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

This backport fixes TrafficPolicy retry translation by ensuring inherited retry settings are applied at the Envoy route level (rather than virtual host level), preserving consistent behavior and precedence (including for HTTPS listener translation).

Changes:

  • Update TrafficPolicy translation to apply inherited retry policy per-route (without overriding any already-set route retry policy).
  • Refresh golden output to reflect route-level retry policy placement.
  • Add a golden translator test covering HTTPS listener retries.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/kgateway/extensions2/plugins/trafficpolicy/traffic_policy_plugin.go Moves inherited retry application from vhost scope to per-route via a shared helper that preserves precedence.
pkg/kgateway/translator/gateway/gateway_translator_test.go Adds a new translator golden test case for HTTPS TrafficPolicy retries.
pkg/kgateway/translator/gateway/testutils/inputs/traffic-policy/https-retry.yaml New input fixture exercising HTTPS listener + HTTPRoute-attached TrafficPolicy retry.
pkg/kgateway/translator/gateway/testutils/outputs/traffic-policy/https-retry.yaml New expected output verifying retryPolicy appears on the route for HTTPS.
pkg/kgateway/translator/gateway/testutils/outputs/traffic-policy/timeout-retry.yaml Updates expected output to remove vhost retryPolicy and show retryPolicy on each route instead.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@davidjumani
davidjumani added this pull request to the merge queue Jul 13, 2026
Merged via the queue into kgateway-dev:v2.2.x with commit fdd7fb4 Jul 13, 2026
39 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.

5 participants