Skip to content

test(conformance): add HTTPRoute rule precedence test - #5128

Open
thorn3r wants to merge 1 commit into
kubernetes-sigs:mainfrom
thorn3r:conformance/httproute-rules-precedence
Open

test(conformance): add HTTPRoute rule precedence test#5128
thorn3r wants to merge 1 commit into
kubernetes-sigs:mainfrom
thorn3r:conformance/httproute-rules-precedence

Conversation

@thorn3r

@thorn3r thorn3r commented Jul 30, 2026

Copy link
Copy Markdown

What type of PR is this?
/kind test
/area conformance-test

What this PR does / why we need it:
Adds conformance coverage for HTTPRoutes with equally matching rules. The test verifies that the first matching rule in list order takes precedence, matching the HTTPRouteRule spec:

If ties still exist within an HTTPRoute, matching precedence MUST be granted to the FIRST matching rule (in list order) with a match meeting the above criteria.

Does this PR introduce a user-facing change?:

NONE

Add conformance coverage for HTTPRoutes with equally matching rules.
Verify that the first matching rule in list order takes precedence.

This behavior is required by the HTTPRouteRule specification:

"If ties still exist within an HTTPRoute, matching precedence MUST be granted
to the FIRST matching rule (in list order) with a match meeting the above
criteria."

Signed-off-by: Tim Horner <timothy.horner@isovalent.com>
@kubernetes-prow kubernetes-prow Bot 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 Jul 30, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from candita and snorwin July 30, 2026 20:10
@kubernetes-prow kubernetes-prow Bot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 30, 2026
@kubernetes-prow

Copy link
Copy Markdown

Welcome @thorn3r!

It looks like this is your first PR to kubernetes-sigs/gateway-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gateway-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow kubernetes-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 30, 2026
@kubernetes-prow

Copy link
Copy Markdown

Hi @thorn3r. 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.

@kubernetes-prow kubernetes-prow Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 30, 2026
@snorwin

snorwin commented Aug 4, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@thorn3r were you able to successfully verify this test against any implementation?

@kubernetes-prow kubernetes-prow Bot 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 Aug 4, 2026
@snorwin

snorwin commented Aug 4, 2026

Copy link
Copy Markdown
Member

/retest

@snorwin snorwin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@thorn3r thanks.

/lgtm

I was able to successfully run the test with Airlock Microgateway:

=== RUN   TestConformance/HTTPRouteRuleOrder
    conformance.go:72: 2026-08-04T15:54:17.39596637+02:00: Applying tests/httproute-rule-order.yaml
    apply.go:289: 2026-08-04T15:54:17.416426469+02:00: Creating rule-order HTTPRoute
    apply.go:289: 2026-08-04T15:54:17.425224314+02:00: Creating rule-order-invalid-backend HTTPRoute
    helpers.go:310: 2026-08-04T15:54:17.628199107+02:00: Gateways and Pods in gateway-conformance-infra namespaces ready
    helpers.go:822: 2026-08-04T15:54:17.638005049+02:00: Conditions matched expectations
    helpers.go:822: 2026-08-04T15:54:17.638077319+02:00: Route gateway-conformance-infra/rule-order Parents matched expectations
    helpers.go:822: 2026-08-04T15:54:17.641813589+02:00: Conditions matched expectations
    helpers.go:822: 2026-08-04T15:54:17.641848767+02:00: Route gateway-conformance-infra/rule-order-invalid-backend Parents matched expectations
=== RUN   TestConformance/HTTPRouteRuleOrder/first_matching_rule_routes_to_its_backend
=== PAUSE TestConformance/HTTPRouteRuleOrder/first_matching_rule_routes_to_its_backend
=== CONT  TestConformance/HTTPRouteRuleOrder/first_matching_rule_routes_to_its_backend
    httproute-rule-order.go:86: 2026-08-04T15:54:17.649920246+02:00: Making GET request to host  via http://100.126.242.160/rule-order
    http.go:331: 2026-08-04T15:54:17.65914691+02:00: Request passed
--- PASS: TestConformance/HTTPRouteRuleOrder/first_matching_rule_routes_to_its_backend (0.01s)
=== RUN   TestConformance/HTTPRouteRuleOrder/invalid_first_matching_rule_returns_500
=== PAUSE TestConformance/HTTPRouteRuleOrder/invalid_first_matching_rule_returns_500
=== CONT  TestConformance/HTTPRouteRuleOrder/invalid_first_matching_rule_returns_500
    httproute-rule-order.go:86: 2026-08-04T15:54:17.64993226+02:00: Making GET request to host  via http://100.126.242.160/rule-order-invalid-backend
    http.go:331: 2026-08-04T15:54:17.655134926+02:00: Request passed
--- PASS: TestConformance/HTTPRouteRuleOrder/invalid_first_matching_rule_returns_500 (0.01s)
    apply.go:295: 2026-08-04T15:54:17.659207941+02:00: Deleting rule-order-invalid-backend HTTPRoute
    apply.go:295: 2026-08-04T15:54:17.668394451+02:00: Deleting rule-order HTTPRoute
--- PASS: TestConformance/HTTPRouteRuleOrder (0.27s)

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 4, 2026
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: snorwin, thorn3r
Once this PR has been reviewed and has the lgtm label, please assign howardjohn 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

@thorn3r

thorn3r commented Aug 4, 2026

Copy link
Copy Markdown
Author

@snorwin yes I tested against Cilium. Just merged a bugfix for this in this PR that also includes similar test coverage. Test output here: https://gist.github.com/thorn3r/f186d49274747dbfa30ce483fc6650d3

@snorwin

snorwin commented Sep 2, 2026

Copy link
Copy Markdown
Member

/assign @youngnick

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 lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. 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.

3 participants