test(conformance): add HTTPRoute rule precedence test - #5128
Conversation
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>
|
Welcome @thorn3r! |
|
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 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. |
|
/ok-to-test @thorn3r were you able to successfully verify this test against any implementation? |
|
/retest |
snorwin
left a comment
There was a problem hiding this comment.
@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)
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: snorwin, thorn3r 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 |
|
@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 |
|
/assign @youngnick |
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:
Does this PR introduce a user-facing change?: