Skip to content

conformance: add BackendRef URLRewrite and RequestRedirect tests#4823

Open
Srujan-rai wants to merge 3 commits into
kubernetes-sigs:mainfrom
Srujan-rai:httproute-backend-filters
Open

conformance: add BackendRef URLRewrite and RequestRedirect tests#4823
Srujan-rai wants to merge 3 commits into
kubernetes-sigs:mainfrom
Srujan-rai:httproute-backend-filters

Conversation

@Srujan-rai
Copy link
Copy Markdown

Summary

Motivation

Issues #2937 and #2936 identified missing conformance tests for URLRewrite and RequestRedirect filters at the HTTPBackendRef level. Rule-level redirect is already tested, but BackendRef-level filters are structurally different and require their own test coverage.

Changes

  • pkg/features/httproute.go: two new Extended features + entries in HTTPRouteExtendedFeatures
  • conformance/tests/httproute-backend-url-rewrite.{go,yaml}: new test pair
  • conformance/tests/httproute-backend-request-redirect.{go,yaml}: new test pair
Add conformance tests for URLRewrite and RequestRedirect filters at HTTPBackendRef level (HTTPRouteBackendURLRewrite, HTTPRouteBackendRequestRedirect extended features)

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label May 3, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Srujan-rai
Once this PR has been reviewed and has the lgtm label, please assign danwinship for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from kl52752 and rikatz May 3, 2026 15:31
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @Srujan-rai. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 3, 2026
@snorwin
Copy link
Copy Markdown
Member

snorwin commented May 4, 2026

@Srujan-rai, I noticed this PR also includes the changes from #4811. It would be helpful to keep them separate if possible.

@Srujan-rai Srujan-rai force-pushed the httproute-backend-filters branch from 90fc28f to 5ba6d41 Compare May 4, 2026 08:19
@Srujan-rai
Copy link
Copy Markdown
Author

Srujan-rai commented May 4, 2026

@Srujan-rai, I noticed this PR also includes the changes from #4811. It would be helpful to keep them separate if possible.

Thanks for catching that @snorwin The branch was based on my local main which already had the GRPCRoute commit. I've rebased httproute-backend-filters onto upstream main PR now contains only the BackendRef URLRewrite/RequestRedirect changes.

@snorwin
Copy link
Copy Markdown
Member

snorwin commented May 7, 2026

@Srujan-rai were you able to validate the new tests against a Gateway API implementation? If so, could you let us know which one?

@Srujan-rai
Copy link
Copy Markdown
Author

@Srujan-rai were you able to validate the new tests against a Gateway API implementation? If so, could you let us know which one?

@snorwin
I Tested against [Envoy Gateway v1.4.1]on [Google Kubernetes Engine (GKE)] running Kubernetes v1.35. The conformance suite initialized successfully, and both tests executed as expected.

Envoy Gateway returned ResolvedRefs=False with the reason UnsupportedRefValue:

"Specific filter is not supported within BackendRef, only RequestHeaderModifier, ResponseHeaderModifier and gateway.envoyproxy.io/HTTPRouteFilter are supported."

This confirms that the tests are structurally correct and accurately detect that URLRewrite and RequestRedirect filters at the BackendRef level are not yet implemented in Envoy Gateway, which is the intended purpose of these conformance tests.

@snorwin
Copy link
Copy Markdown
Member

snorwin commented May 11, 2026

@Srujan-rai it seems that Envoy Gateway isn't supporting this, can you try to test it with kgateway?

Comment thread conformance/tests/httproute-backend-url-rewrite.go Outdated
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 11, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: Srujan-rai / name: Srujan rai (d7abb19)
  • ✅ login: Srujan-rai / name: srujan-rai (5ba6d41)
  • ✅ login: snorwin / name: Norwin Schnyder (d7abb19)

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 11, 2026
@Srujan-rai
Copy link
Copy Markdown
Author

@Srujan-rai it seems that Envoy Gateway isn't supporting this, can you try to test it with kgateway?

Tested against kgateway v2.3.0-rc.2 as suggested. The HTTPRoute is accepted successfully (ResolvedRefs=True and the route is programmed), but the rewrite is not applied at the BackendRef level. Requests continue with the original path unchanged.

From what I could verify, both Envoy Gateway and kgateway currently only support RequestHeaderModifier and ResponseHeaderModifier filters at BackendRef scope.

That makes me wonder if there’s any implementation today that supports URLRewrite or RequestRedirect under backendRef.filters. The spec allows it, but if there isn’t an implementation supporting it yet, these conformance tests might be a bit early.

Happy to adjust the approach or pause the PR until support lands in an implementation.

Copy link
Copy Markdown
Contributor

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

Agentgateway supports this:

--- PASS: TestConformance (0.86s)
    --- PASS: TestConformance/HTTPRouteBackendRequestRedirect (0.12s)
        --- PASS: TestConformance/HTTPRouteBackendRequestRedirect/1_request_to_'/prefix/original'_should_receive_one_of_[] (0.01s)
        --- PASS: TestConformance/HTTPRouteBackendRequestRedirect/0_request_to_'/full/original'_should_receive_one_of_[] (0.01s)
PASS

@snorwin
Copy link
Copy Markdown
Member

snorwin commented May 12, 2026

/easycla

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 12, 2026
Comment thread conformance/tests/httproute-backend-request-redirect.go Outdated
@snorwin
Copy link
Copy Markdown
Member

snorwin commented May 12, 2026

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 12, 2026
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 20, 2026
@Srujan-rai Srujan-rai force-pushed the httproute-backend-filters branch from 1107000 to c39c73c Compare May 20, 2026 14:10
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 20, 2026
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 28, 2026
Srujan-rai and others added 3 commits May 29, 2026 19:40
…ernetes-sigs#2937, kubernetes-sigs#2936)

Add SupportHTTPRouteBackendURLRewrite and
SupportHTTPRouteBackendRequestRedirect feature constants so implementations
can declare Extended support for these filters at the HTTPBackendRef level.

Add focused conformance tests covering ReplaceFullPath and
ReplacePrefixMatch for each filter type applied via backendRef.filters,
rather than at the rule level.
Co-authored-by: Norwin Schnyder <github@snorwin.io>
@Srujan-rai Srujan-rai force-pushed the httproute-backend-filters branch from c39c73c to e2f4182 Compare May 29, 2026 14:10
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

conformance - HTTPBackendRef Filter HTTPRouteFilterURLRewrite conformance - HTTPBackendRef Filter HTTPRouteFilterRequestRedirect

4 participants