← Back to Pull requests

fix(provider): reconcile on namespace label changes for allowedListeners selectors #10710

Open
susheelg1197 opened this pull request with 102 lines diff across 4 files
View on GitHub
susheelg1197 susheelg1197 commented on Nov 26, 2026 04:52 UTC
Author

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 when hasSelectorAllowedRoutesListener returns true, and that function checked only allowedRoutes.namespaces.from: Selector on 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 the allowedListeners case of #9625 / #9649.

Changes:

  • internal/provider/kubernetes/predicates.go:

  • - The predicate also returns true when a Gateway's allowedListeners.namespaces.from is Selector, through a new hasListenerNamespacesFromSelector.
    - It's renamed to hasNamespaceSelectorListener, since it's no longer only about allowedRoutes.
  • 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 in Resources.Namespaces, as the existing comment describes for routes.

    Testing:

  • New TestHasNamespaceSelectorListener in predicates_test.go covers four cases: no selector (false); an allowedRoutes selector on a Gateway listener (true); an allowedListeners selector on a Gateway (true, the #10709 case); and allowedListeners from Same (false). The allowedListeners selector case fails without the new check.

  • go test ./internal/provider/kubernetes/ and go vet pass.

  • golangci-lint run ./internal/provider/kubernetes/... reports only existing SA1019 deprecation findings, none on changed lines.

  • I didn't run it against a live cluster.
  • Which issue(s) this PR fixes:

    Fixes #10709

    ---

    PR Checklist

  • Authorship & ownership: Written with an AI coding assistant (Claude Code). I reviewed every change, understand how and why it works, and take responsibility for it.

  • DCO: All commits are signed off.

  • API agreed first: N/A, no API changes.

  • Required checks pass: make generate gen-check and the full make 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.

  • Tests added/updated

  • Docs: N/A. This is a bug fix, and the documented behaviour doesn't change.

  • Release notes: release-notes/current/bug_fixes/10709-allowed-listeners-namespace-label.md

  • Generated files committed: N/A, no API, helm or module changes.

  • Scope & compatibility: limited to the Namespace watch predicate, and backward compatible.

  • Codex review: not requested; I don't have access to request it.

  • Copilot review: not requested; I don't have access to request it.
  • 🤖 Generated with Claude Code

    Diff: 102 lines (+98 / -4) across 4 files Reviewer: zirain Review duration: 9980m
    All Vouch review confidence checks passed
    Residual risk 0.12 = Change Risk (0.35) × (1 − Review Confidence (0.67)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.35 · 102 lines diff across 4 files
    0.35
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.56 · 5 substantive comment(s)
    0.56
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    67%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.277
    Real PR Conversation Timeline
    7 items
    netlify[bot] netlify[bot] commented on Nov 26, 2026 04:52 UTC
    Bot

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

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Nov 26, 2026 04:52 UTC
    Bot

    <!-- 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

  • Open a pull request for review

  • Mark a draft as ready

  • Comment "@codex review" or "@codex security review".
  • 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[bot] codecov[bot] commented on Nov 26, 2026 05:09 UTC
    Bot

    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>

  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

  • </details>

    zirain zirain approved these changes on Nov 26, 2026 08:51 UTC
    Approved Reviewer

    Approved these changes.

    susheelg1197 susheelg1197 commented on Nov 26, 2026 20:52 UTC
    Author

    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.

    zirain zirain commented on Nov 27, 2026 01:32 UTC
    Contributor

    /retest

    Reviewers
    Assignees
    susheelg1197 susheelg1197
    Labels
    risk: low confidence: 67.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 35.1% (MEDIUM) · Higher = larger blast radius
    35.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 67.2% · Lower = rushed or shallow review
    67.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 11.5% · Safe to merge
    11.5%