Skip to content

conformance: add cross-namespace ListenerSet AllowedRoutes test - #4841

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
asauber:add-cross-namespace-listenerset-test
May 12, 2026
Merged

k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
asauber:add-cross-namespace-listenerset-test

Conversation

@asauber

@asauber asauber commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind test
/area conformance-test

What this PR does / why we need it:

In GEP 1713 under the Conformance Details section, case number 13 makes it clear that AllowedRoutes.Namespaces.From being set to Same on a ListenerSet means that only Routes from the ListenerSet's namespace should be accepted, and not routes from the Gateway's namespace.

This PR adds a test which verifies that AllowedRoutes.Namespaces.From: Same on a ListenerSet listener is evaluated relative to the ListenerSet's namespace, not the parent Gateway's namespace.

The existing ListenerSetAllowedRoutesNamespaces test places both resources in the same namespace, making it possible for an implementation to incorrectly attribute the value of 'Same' in a ListenerSet spec to mean the GatewayAPI's namespace, and not the ListenerSet namespace.

This test has been confirmed to catch this bug in a pre-release implementation of ListenerSet.

Does this PR introduce a user-facing change?:

Add conformance test `ListenerSetAllowedRoutesCrossNamespace` which verifies that a ListenerSet only allows routes in its own namespace by default

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 11, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Welcome @asauber!

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. 😃

@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. labels May 11, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @asauber. 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 release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels May 11, 2026
@asauber
asauber marked this pull request as ready for review May 11, 2026 07:55
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 11, 2026
@snorwin

snorwin commented May 11, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@asauber did you manage to run the test against any Gateway API implementation?

@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 11, 2026

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

@asauber thanks for the PR, nice work.

I can confirm that Airlock Microgateway is successfully passing the proposed conformance tests.

However I would prefer to integrate the new test cases into ListenerSetAllowedRoutesNamespaces and reusing the existing gateway-with-listener-sets-test-allowed-routes Gateway, as each additional Gateway adds resource overhead and setup time, so keeping the suite lean here would be a nice win.

@rikatz

rikatz commented May 11, 2026

Copy link
Copy Markdown
Member

nice work, thanks!

I agree with @snorwin if we could avoid creating a new gateway and instead using the existing one for ListenerSet test, and adding this case as part of it I think it would be better

/approve

@snorwin leaving the lgtm for you once you are happy with it

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 11, 2026
@asauber
asauber force-pushed the add-cross-namespace-listenerset-test branch from a77d834 to 8f676b2 Compare May 12, 2026 07:14
@asauber

asauber commented May 12, 2026 •

Copy link
Copy Markdown
Contributor Author

did you manage to run the test against any Gateway API implementation?

Yes, but only against an early (not pushed) prototype of ListenerSet in Cilium. This test caught this bug in that implementation.

However I would prefer to integrate the new test cases into ListenerSetAllowedRoutesNamespaces

Pushed that updated here

Thank you for the reviews!

@asauber
asauber force-pushed the add-cross-namespace-listenerset-test branch from 8f676b2 to 62b830b Compare May 12, 2026 08:27
Verify that AllowedRoutes.Namespaces.From: Same on a ListenerSet
listener is evaluated relative to the ListenerSet's namespace, not the
parent Gateway's namespace.

The existing ListenerSetAllowedRoutesNamespaces test places both
resources in the same namespace, making it possible for an
implementation to incorrectly attribute the value of 'Same' in a
ListenerSet spec to mean the GatewayAPI's namespace, and not the
ListenerSet namespace.

This test has been confirmed to catch this bug in a pre-release
implementation of ListenerSet.

Signed-off-by: Andrew Sauber <andrew.sauber@isovalent.com>
@asauber
asauber force-pushed the add-cross-namespace-listenerset-test branch from 62b830b to 4ad50f5 Compare May 12, 2026 10:43
@asauber

asauber commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

@snorwin great feedback, thanks. I think I've addressed all of it. Also checked locally that the test compiles and passes with my local implementation.

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

@asauber nice work, thanks a lot.
/lgtm

Airlock Microgateway successfully passed all ListenerSetAllowedRoutesNamespaces tests:

=== RUN   TestConformance/ListenerSetAllowedRoutesNamespaces
=== RUN   TestConformance/ListenerSetAllowedRoutesNamespaces/Cross-namespace_ListenerSet
=== RUN   TestConformance/ListenerSetAllowedRoutesNamespaces/Same-namespace_ListenerSet
...
--- PASS: TestConformance/ListenerSetAllowedRoutesNamespaces/Cross-namespace_ListenerSet (0.03s)
--- PASS: TestConformance/ListenerSetAllowedRoutesNamespaces/Same-namespace_ListenerSet (0.04s)
--- PASS: TestConformance/ListenerSetAllowedRoutesNamespaces (4.95s)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 12, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: asauber, rikatz, snorwin

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

The pull request process is described 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 merged commit ec7d5a2 into kubernetes-sigs:main May 12, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. 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 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.

4 participants