Skip to content

Conversation

@kxiong0
Copy link

@kxiong0 kxiong0 commented Jan 11, 2026

Motivation

Envoy RetryPolicy supports retrying on conditions under both x-envoy-retry-on and x-envoy-retry-grpc-on. Therefore Kuma should allow all conditions, including http retryOn conditions, for grpc services.

Implementation information

  • MeshRetry policy validator updated to allow input in grpc.retryOn if it is a valid http retryOn value
  • Removed enum constraint on MeshRetry CRD to accept status code entries
  • MeshRetry configurer updated to support http and grpc conditions
    • Moved logic for separating retryOn values and retriable status codes and request headers to function HttpRetriables
    • Renamed GrpcRetryOn to GrpcRetriables, which now returns retryOn values and status codes / headers

Supporting documentation

Addresses #12931

@github-actions
Copy link
Contributor

Reviewer Checklist

🔍 Each of these sections need to be checked by the reviewer of the PR 🔍:
If something doesn't apply please check the box and add a justification if the reason is non obvious.

  • Is the PR title satisfactory? Is this part of a larger feature and should be grouped using > Changelog?
  • PR description is clear and complete. It Links to relevant issue as well as docs and UI issues
  • This will not break child repos: it doesn't hardcode values (.e.g "kumahq" as an image registry)
  • IPv6 is taken into account (.e.g: no string concatenation of host port)
  • Tests (Unit test, E2E tests, manual test on universal and k8s)
    • Don't forget ci/ labels to run additional/fewer tests
  • Does this contain a change that needs to be notified to users? In this case, UPGRADE.md should be updated.
  • Does it need to be backported according to the backporting policy? (this GH action will add "backport" label based on these file globs, if you want to prevent it from adding the "backport" label use no-backport-autolabel label)

@kxiong0 kxiong0 marked this pull request as ready for review January 11, 2026 19:05
@kxiong0 kxiong0 requested a review from a team as a code owner January 11, 2026 19:05
@kxiong0 kxiong0 requested review from bartsmykla and slonka January 11, 2026 19:05
@slonka slonka requested a review from Copilot January 13, 2026 11:22
Copy link
Contributor

Copilot AI left a comment

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 extends the MeshRetry policy to support HTTP retry conditions for gRPC services, aligning with Envoy's capability to retry on conditions under both x-envoy-retry-on and x-envoy-retry-grpc-on headers.

Changes:

  • Updated MeshRetry validator to accept HTTP retryOn values in gRPC retryOn configuration
  • Refactored XDS configurer to extract common logic for processing HTTP retriables (status codes, methods, retry conditions)
  • Removed enum constraint from CRD to allow status code entries in gRPC retryOn field

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/plugins/policies/meshretry/plugin/xds/configurer.go Refactored retry configuration logic: renamed GrpcRetryOn to GrpcRetriables to handle both gRPC and HTTP retry conditions; extracted HttpRetriables function to consolidate status code and method processing; fixed ensureRetriableStatusCodes to handle empty strings
pkg/plugins/policies/meshretry/plugin/v1alpha1/testdata/grpc.listeners.golden.yaml Updated golden file to reflect new gRPC retry policy supporting HTTP conditions (status codes, request headers)
pkg/plugins/policies/meshretry/plugin/v1alpha1/plugin_test.go Added test cases for mixed gRPC/HTTP retry conditions including ConnectFailure, HttpMethodGet, and status code "429"
pkg/plugins/policies/meshretry/k8s/crd/kuma.io_meshretries.yaml Removed enum constraint on grpc.retryOn to accept string values; updated description and examples to show HTTP retry support
pkg/plugins/policies/meshretry/api/v1alpha1/validator_test.go Extended validation tests to cover all HTTP retry conditions (5xx, GatewayError, methods, status codes) in gRPC context; updated negative test case from "500" to "123" since "500" is now valid
pkg/plugins/policies/meshretry/api/v1alpha1/validator.go Enhanced validateGRPCRetryOn to fallback to HTTP retry validation when value is not a known gRPC enum

Comment on lines 202 to 203
cause a retry.
Also, http RetryOn values are supported.
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description could be more precise. Consider rewording to: "RetryOn is a list of conditions which will cause a retry. Supports both gRPC retry conditions (Canceled, DeadlineExceeded, Internal, ResourceExhausted, Unavailable) and HTTP retry conditions (see HTTP retryOn for full list)." This makes it clearer that both types of conditions are supported.

Suggested change
cause a retry.
Also, http RetryOn values are supported.
cause a retry. Supports both gRPC retry conditions (Canceled,
DeadlineExceeded, Internal, ResourceExhausted, Unavailable) and HTTP
retry conditions (see HTTP retryOn for full list).

Copilot uses AI. Check for mistakes.
retryOn:
description: RetryOn is a list of conditions which will
cause a retry.
cause a retry.
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected at the end of this line. This should be removed to maintain consistent formatting in the YAML file.

Suggested change
cause a retry.
cause a retry.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant