conformance: add BackendRef URLRewrite and RequestRedirect tests#4823
conformance: add BackendRef URLRewrite and RequestRedirect tests#4823Srujan-rai wants to merge 3 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Srujan-rai The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
@Srujan-rai, I noticed this PR also includes the changes from #4811. It would be helpful to keep them separate if possible. |
90fc28f to
5ba6d41
Compare
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. |
|
@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 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. |
|
@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. |
howardjohn
left a comment
There was a problem hiding this comment.
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
|
/easycla |
|
/ok-to-test |
1107000 to
c39c73c
Compare
…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>
c39c73c to
e2f4182
Compare
Summary
SupportHTTPRouteBackendURLRewritefeature constant and conformance test for URLRewrite filter onHTTPBackendRef(fixes conformance - HTTPBackendRef Filter HTTPRouteFilterURLRewrite #2937)SupportHTTPRouteBackendRequestRedirectfeature constant and conformance test for RequestRedirect filter onHTTPBackendRef(fixes conformance - HTTPBackendRef Filter HTTPRouteFilterRequestRedirect #2936)ReplaceFullPathandReplacePrefixMatchfor each filter type applied viabackendRef.filters(not rule-level)Motivation
Issues #2937 and #2936 identified missing conformance tests for
URLRewriteandRequestRedirectfilters at theHTTPBackendReflevel. 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 newExtendedfeatures + entries inHTTPRouteExtendedFeaturesconformance/tests/httproute-backend-url-rewrite.{go,yaml}: new test pairconformance/tests/httproute-backend-request-redirect.{go,yaml}: new test pair