← Back to Pull requests

Wait for worker Node registration before applying labels #24134

Open
emmeowzing opened this pull request with 766 lines diff across 15 files
View on GitHub
emmeowzing emmeowzing commented on Nov 28, 2026 03:44 UTC
Author

What: Wait for a joined worker's exact Node object before applying Minikube labels. Fixes #24133.

Why: kubeadm can finish TLS bootstrap while Node registration is still pending. The current named-node label command runs before the later node wait and can fail with a transient Node NotFound. This was discovered during the native VM work in #23809; the fix is independent of that feature.

How: Add a read-only registration poll with a one-minute deadline. Retry a missing Node, timeout, unavailable service and throttling; return permanent failures immediately. Start the existing five-second labeling budget after registration. Preserve control-plane initialization and the later readiness check.

Validation: The exact pinned v1.39.0 installation and deterministic reproduction in #24133 were executed before posting, including the expected failure and patched success. The same regression fails on pristine master 61e410233d20e551ff1ec58895ef3d09051300ad. On the patched branch, the full kubeadm package passes go test -race ./pkg/minikube/bootstrapper/kubeadm -count=1 and go vet ./pkg/minikube/bootstrapper/kubeadm. Local environment: macOS 27.0.1 arm64, Go 1.27.3. Hosted CI awaits upstream admission. Source-history findings and bounded duplicate searches are recorded in the issue.

  • Wait for worker registration before labels, with a bounded read-only API operation.

  • Preserve permanent errors, cancellation, later readiness and the separate label budget.

  • Reproduce on pristine release/current master; verify patched regression, package race checks and vet.

  • Upstream review and hosted CI.
  • Prepared by Codex; contact: @emmeowzing. Ready for review as an independent bug fix.

    <!-- witful-work-graph:begin -->

    ---
    config: {"flowchart": {"rankSpacing": 90, "subGraphTitleMargin": {"bottom": 24, "top": 0}}, "layout": "dagre", "theme": "base", "themeVariables": {"edgeLabelBackground": "#F8F9F4", "lineColor": "#647D8B", "primaryTextColor": "#243746"}}
    ---
    flowchart TB
        subgraph n8d0c7ac992af2f4913b47d425af0fe08dca35d157cbf27e40c203589b983d1fd["`project: Minikube integration fork`"]
            n2ad562319767157087dda0dec6391f4479f8a04869ab0cc8d3a9c3637dae73b5["branch: fix/worker-registration-before-labels (active)"]
        end
        subgraph n5086431107cae0151fdd8a231177374dfd063cb427d03273af07d527a23c27d0["`project: Minikube`"]
            nfc613b4dfd6736a7bd268c8a0e74ed0d1c04a959f59dd74ef2874983fd443fc9["branch: master"]
            nc97ace4c8fef2cee8fa0f3c9f52aab18dbd4f42438afe362ffb8f75ce4c04b84["review #35;24134: Worker registration before labels (open#59; review)"]
        end
        n2ad562319767157087dda0dec6391f4479f8a04869ab0cc8d3a9c3637dae73b5 -->|based on| nfc613b4dfd6736a7bd268c8a0e74ed0d1c04a959f59dd74ef2874983fd443fc9
        nc97ace4c8fef2cee8fa0f3c9f52aab18dbd4f42438afe362ffb8f75ce4c04b84 ---|correlates| n2ad562319767157087dda0dec6391f4479f8a04869ab0cc8d3a9c3637dae73b5
        click n2ad562319767157087dda0dec6391f4479f8a04869ab0cc8d3a9c3637dae73b5 href "https://github.com/astrivant/minikube/tree/fix/worker-registration-before-labels" "Open recorded work" _blank
        click nfc613b4dfd6736a7bd268c8a0e74ed0d1c04a959f59dd74ef2874983fd443fc9 href "https://github.com/kubernetes/minikube/tree/master" "Open recorded work" _blank
        click nc97ace4c8fef2cee8fa0f3c9f52aab18dbd4f42438afe362ffb8f75ce4c04b84 href "https://github.com/kubernetes/minikube/pull/24134" "Open recorded work" _blank
        classDef work fill:#F8F9F4,stroke:#647D8B,color:#243746
        class n2ad562319767157087dda0dec6391f4479f8a04869ab0cc8d3a9c3637dae73b5 work
        style n8d0c7ac992af2f4913b47d425af0fe08dca35d157cbf27e40c203589b983d1fd fill:#F8F9F4,stroke:#829B85,color:#243746
        class nfc613b4dfd6736a7bd268c8a0e74ed0d1c04a959f59dd74ef2874983fd443fc9 work
        style n5086431107cae0151fdd8a231177374dfd063cb427d03273af07d527a23c27d0 fill:#F8F9F4,stroke:#829B85,color:#243746
        class nc97ace4c8fef2cee8fa0f3c9f52aab18dbd4f42438afe362ffb8f75ce4c04b84 work
        linkStyle 0 stroke:#829B85,color:#243746
        linkStyle 1 stroke:#B77E79,color:#243746
    

    Containment shows ownership; arrows name recorded relationships.

    Associated work:

  • [branch: fix/worker\-registration\-before\-labels](<https://github.com/astrivant/minikube/tree/fix/worker-registration-before-labels>)

  • [project: Minikube integration fork](<https://github.com/astrivant/minikube>)

  • [branch: master](<https://github.com/kubernetes/minikube/tree/master>)

  • [project: Minikube](<https://github.com/kubernetes/minikube>)

  • [review \#24134: Worker registration before labels](<https://github.com/kubernetes/minikube/pull/24134>)
  • <!-- witful-work-graph:end -->

    Committed work graph.

    <img src="https://raw.githubusercontent.com/astrivant/minikube/035034513bbfcec00665983e0980e9f945aecfed/.github/review-evidence/worker-registration/intent/c1d29200a5a29888d73d431d257473ae38239e5c1f601ebd4e2d8b99e85c1a1a/intent.png" alt="Changed-code intent coverage, with six uncovered files" width="90%">

    Intent coverage is explicitly unavailable for this upstream checkout.

    <img src="https://raw.githubusercontent.com/astrivant/minikube/035034513bbfcec00665983e0980e9f945aecfed/.github/review-evidence/worker-registration/files/files-001.png" alt="Changed text lines for all six source and work-graph files" width="100%">

    <img src="https://raw.githubusercontent.com/astrivant/minikube/035034513bbfcec00665983e0980e9f945aecfed/.github/review-evidence/worker-registration/language/languages.png" alt="Changed text lines grouped by language" width="50%">

    The figures measure added plus deleted text lines for source revision 8dede42. The root review-evidence directory is excluded before measurement.

    Diff: 766 lines (+763 / -3) across 15 files Reviewer: prezha Review duration: 3447m
    All Vouch review confidence checks passed
    Residual risk 0.33 = Change Risk (0.63) × (1 − Review Confidence (0.48)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.63 · 766 lines diff across 15 files
    0.63
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.14 · 1 substantive comment(s)
    0.14
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    47%
    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.397
    Shallow Review Depth shallow_review_depth
    0.303
    Real PR Conversation Timeline
    1 comments
    "Review active on #24134"
    general weight: 0.35
    Reviewers
    Assignees
    emmeowzing emmeowzing
    Labels
    risk: low confidence: 47.6% 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: 63.3% (MEDIUM) · Higher = larger blast radius
    63.3%
    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: 47.6% · Lower = rushed or shallow review
    47.6%
    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: 33.1% · Safe to merge
    33.1%