← Back to Pull requests

fix: add kubeadmRbac to soot triggers slice #1169

Closed
unknown closed this pull request without merging on Aug 02, 2026 14:46 UTC
View on GitHub
unknown unknown commented on Jun 04, 2026 22:57 UTC
Author

Fixes #1167.

Root cause. Since kubeadm v1.29 (KEP-2305), admin.conf carries O=kubeadm:cluster-admins instead of O=system:masters. The matching kubeadm:cluster-admins → cluster-admin ClusterRoleBinding is created by PhaseClusterAdminRBAC in the soot manager. Two gaps prevent the CRB from being created quickly enough:

1. kubeadmRbac.TriggerChannel was absent from the sootItem.triggers slice — so when the TCP reconciler notifies soot controllers, PhaseClusterAdminRBAC was never poked. It could only reconcile when a kubeadm:* ClusterRoleBinding watch event fired, which never happens on a brand-new cluster.

2. Even after adding the trigger, it only fires on subsequent TCP reconciles (when the manager is already in sootMap). On initial startup the reconciler returns RequeueAfter:time.Second and exits — the CRB isn't created until the next TCP reconcile, leaving a 3–10 second window where admin.conf callers receive 403.

Fix. Two changes, together closing the initial-creation window:

  • Make kubeadmRbac.TriggerChannel buffered (cap 1). An unbuffered channel requires a live consumer; a pre-startup send would block until the manager goroutine starts consuming. Buffered lets the send succeed immediately.

  • Pre-seed TriggerChannel with one event immediately after launching the manager goroutine. When the soot manager's cache warms up, source.Channel drains the buffer and enqueues a reconcile for kubeadmRbac, which calls EnsureAdminClusterRoleBinding and mints the CRB without waiting for an external event.
  • The trigger in sootItem.triggers is retained for drift correction: if the CRB is deleted on a running cluster, the next TCP reconcile re-triggers PhaseClusterAdminRBAC and restores it.

    Diff: 219 lines (+164 / -55) across 2 files Reviewer: HarshavardhanK Review duration: 84468m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.60) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.60 · 219 lines diff across 2 files
    0.60
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.323
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.060
    Real PR Conversation Timeline
    1 comments
    "Review active on #1169"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 59.9% (MEDIUM) · Higher = larger blast radius
    59.9%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 23.7% · Safe to merge
    23.7%
    Repository