Skip to content

Conformance tests for HTTPRouteFilterURLRewrite on BackendRef #3869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

chris-kaiser-7
Copy link

What type of PR is this?

/kind test
/area conformance-test

What this PR does / why we need it:
Adds conformance tests for HTTPRouteFilterURLRewrite on the BackendRef for Host, Host+Weights, Host+Headers, Path, Path+Weights, Path+Headers. There was no coverage for HTTPRouteFilterURLRewrite on BackendRef.

Which issue(s) this PR fixes:

Fixes #2937

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/test area/conformance-test Issues or PRs related to Conformance tests. labels Jun 19, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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 added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 19, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @chris-kaiser-7. 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.

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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 19, 2025
@chris-kaiser-7 chris-kaiser-7 changed the title Working tests for HTTPRouteFilterURLRewrite on BackendRef Jun 19, 2025
@chris-kaiser-7 chris-kaiser-7 changed the title tests for HTTPRouteFilterURLRewrite on BackendRef Conformance tests for HTTPRouteFilterURLRewrite on BackendRef Jun 19, 2025
@chris-kaiser-7
Copy link
Author

I tested this with envoy implementation. Envoy had a validation check preventing this. I removed the validation check but the test still failed. I guess envoy doesn't support this. I am going to try on other implementations tho.

Comment on lines 37 to 40
Features: []features.FeatureName{
features.SupportGateway,
features.SupportHTTPRoute,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

This will definitely need an Extended feature at least, since I suspect that implementability will vary wildly.

Copy link
Member

Choose a reason for hiding this comment

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

We definitely need it, as the feature is extended

Copy link
Author

Choose a reason for hiding this comment

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

Ok thanks for finding this. I updated this and a few others that had incorrect features.

@robscott
Copy link
Member

I tested this with envoy implementation. Envoy had a validation check preventing this. I removed the validation check but the test still failed. I guess envoy doesn't support this. I am going to try on other implementations tho.

Unfortunately, I think it will be hard to find an implementation that supports this today. Recommend asking in #sig-network-gateway-api Slack channel.

Copy link
Member

@mlavacca mlavacca left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, @chris-kaiser-7! I've left a few comments inline

features.SupportGateway,
features.SupportHTTPRoute,
},
Manifests: []string{"tests/httproute-rewrite-host-backend-weights.yaml"},
Copy link
Member

Choose a reason for hiding this comment

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

We do need to set the test as provisional with Provisional: true, as this is a new addition to the test suite

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for pointing this out. I added Provisional to all the rewrite tests. Am I correct to assume all new tests need Provisional set to true and at some release in the future it is removed?

// Assert request succeeds before checking traffic
http.MakeRequestAndExpectEventuallyConsistentResponse(t, s.RoundTripper, s.TimeoutConfig, gwAddr, expected)

for range 100 {
Copy link
Member

Choose a reason for hiding this comment

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

why 100? can we extract this number into a const?

Copy link
Author

Choose a reason for hiding this comment

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

I was using httproute-request-header-modifier-backend-weights.go as a reference for how to do weights, but I will go ahead and update all these to use a const instead of magic numbers.

Comment on lines 37 to 40
Features: []features.FeatureName{
features.SupportGateway,
features.SupportHTTPRoute,
},
Copy link
Member

Choose a reason for hiding this comment

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

We definitely need it, as the feature is extended

Comment on lines +31 to +45
- backendRefs:
- name: infra-backend-v1
port: 8080
weight: 50
filters:
- type: URLRewrite
urlRewrite:
hostname: infra-backend-v1.two
- name: infra-backend-v2
port: 8080
weight: 50
filters:
- type: URLRewrite
urlRewrite:
hostname: infra-backend-v2.two
Copy link
Member

Choose a reason for hiding this comment

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

These backendrefs do not look properly indented

@chris-kaiser-7
Copy link
Author

Should I add a new features such as SupportHTTPRouteHostRewriteBackend for this? or is SupportHTTPRouteHostRewrite sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/conformance-test Issues or PRs related to Conformance tests. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/test needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

conformance - HTTPBackendRef Filter HTTPRouteFilterURLRewrite
5 participants