fix(provider): reconcile on namespace label changes for allowedListeners selectors #10710
<span aria-hidden="true">✅</span> Deploy Preview for cerulean-figolla-1f9435 ready!
Built without sensitive environment variables
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 1cb48405e7041681f6f45935429896e55db2e680 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6b07bb131b13950e5da1ae77 |
|<span aria-hidden="true">😎</span> Deploy Preview | https://deploy-preview-10710--cerulean-figolla-1f9435.netlify.app |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />!QR Code<br /><br />_Use your smartphone camera to open QR code link._</details> |
---
<!-- cerulean-figolla-1f9435 Preview -->
_To edit notification comments on pull requests, go to your Netlify project configuration._
<!-- codex-pull-request-review-summary -->
<!-- codex-review-state:v1 {"code_review":{"commit_sha":"1cb48405e7041681f6f45935429896e55db2e680","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} -->
<details>
<summary><strong>Codex Review Summary</strong>: ✅ Completed</summary>
This comment shows the latest Codex review activity on this pull request.
| Review | Status | Commit | Review trigger |
| --- | --- | --- | --- |
| 📝 Code Review | ✅ Completed <relative-time datetime="2026-11-26T04:54:57.633629Z">2026-11-26T04:54:57.633629Z</relative-time> | 1cb4840 | PR opened |
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
</details>
</details>
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 82.82%. Comparing base (
53709ce) to head (1cb4840).<details><summary>Additional details and impacted files</summary>
@@ Coverage Diff @@
## main #10710 +/- ##
=======================================
Coverage 82.81% 82.82%
=======================================
Files 278 278
Lines 44620 44625 +5
=======================================
+ Hits 36953 36960 +7
+ Misses 7666 7664 -2
Partials 1 1
</details>
:umbrella: View full report in Codecov by Harness.
:loudspeaker: Have feedback on the report? Share it here.
<details><summary> :rocket: New features to boost your workflow: </summary>
</details>
Approved these changes.
Thanks for the approval. The one red check is conformance-test (v1.34.11, ipv4, default, standard, true), which failed on BackendTLSPolicySANValidation/HTTP_request_sent_to_Service_with_valid_BackendTLSPolicy_containing_multi_SAN_should_succeed after a 30 s timeout. That's backend TLS SAN validation, which this PR doesn't touch, and the same suite passed in the other matrix cells. Could someone re-run that job when convenient? I don't have permission to re-trigger it from a fork.
/retest
zirain
susheelg1197
What this PR does / why we need it:
A Gateway that admits ListenerSets by namespace label (
spec.allowedListeners.namespaces.from: Selector) didn't react when that label changed on a namespace. The Namespace watch enqueues a reconcile only whenhasSelectorAllowedRoutesListenerreturns true, and that function checked onlyallowedRoutes.namespaces.from: Selectoron Gateway and ListenerSet listeners. So with no route selector anywhere, adding or removing the label left the ListenerSet's acceptance stale until something unrelated triggered a reconcile. This is theallowedListenerscase of #9625 / #9649.Changes:
internal/provider/kubernetes/predicates.go:- The predicate also returns true when a Gateway's
allowedListeners.namespaces.fromisSelector, through a newhasListenerNamespacesFromSelector.- It's renamed to
hasNamespaceSelectorListener, since it's no longer only aboutallowedRoutes.internal/provider/kubernetes/controller.go: the call site and the watch comment are updated.release-notes/current/bug_fixes/10709-allowed-listeners-namespace-label.md: the release note.An enqueue then retranslates: a ListenerSet's namespace is already added to
allAssociatedNamespaces(controller.go, where ListenerSets are processed), so the label change shows up as a diff inResources.Namespaces, as the existing comment describes for routes.Testing:
TestHasNamespaceSelectorListenerinpredicates_test.gocovers four cases: no selector (false); anallowedRoutesselector on a Gateway listener (true); anallowedListenersselector on a Gateway (true, the #10709 case); andallowedListenersfromSame(false). TheallowedListenersselector case fails without the new check.go test ./internal/provider/kubernetes/andgo vetpass.golangci-lint run ./internal/provider/kubernetes/...reports only existingSA1019deprecation findings, none on changed lines.Which issue(s) this PR fixes:
Fixes #10709
---
PR Checklist
make generate gen-checkand the fullmake lint/ coverage build weren't run locally. The package tests and a golangci-lint run over the changed package were (see Testing). No generated files are affected.release-notes/current/bug_fixes/10709-allowed-listeners-namespace-label.md🤖 Generated with Claude Code