← Back to Pull requests

OCPBUGS-86643: Skip control-plane label migration on External topolog… #6205

Open
unknown opened this pull request with 342 lines diff across 4 files
View on GitHub
unknown unknown commented on Jun 18, 2026 07:56 UTC
Author

Jira


https://issues.redhat.com/browse/OCPBUGS-86643

Problem


After upgrading HyperShift HostedClusters from 4.20.x to 4.21.x, dedicated
worker nodes incorrectly receive node-role.kubernetes.io/control-plane.
Hub compact nodes that are real control-plane nodes are expected to carry
both master and control-plane labels; guest HostedCluster worker nodes
must not
.

Customer environment:

  • HUB upgraded: 4.20.8 → 4.20.22 → 4.21.15

  • HostedClusters upgraded to 4.21.16

  • NodePool objects exist on the HUB (clusters namespace), not inside guest clusters

  • Incorrect control-plane label observed on existing HostedCluster worker nodes
  • Root cause


    MCO reconcileMaster() calls updateMasterNodeControlPlaneLabel() (added for
    OCPBUGS-58180) to migrate legacy master → control-plane labels. This runs
    without excluding External topology clusters (HyperShift guest clusters),
    where there is no in-cluster control plane.

    Fix


    Skip reconcileMaster() when ControllerConfig.spec.infra.status.controlPlaneTopology == External.

    Files changed


  • pkg/controller/node/node_controller.go — guard in reconcileMaster()

  • pkg/controller/node/node_controller_test.go — unit tests
  • Local testing

    Environment: macOS, branch ocpbugs-86643-skip-cp-label-external-topology, commit 73db7395

    $ cd machine-config-operator
    $ go test ./pkg/controller/node/... -run 'TestReconcileMaster' -count=1 -v
    === RUN   TestReconcileMasterSkipsExternalTopology
    === PAUSE TestReconcileMasterSkipsExternalTopology
    === RUN   TestReconcileMasterAddsControlPlaneLabel
    === PAUSE TestReconcileMasterAddsControlPlaneLabel
    === CONT  TestReconcileMasterSkipsExternalTopology
    === CONT  TestReconcileMasterAddsControlPlaneLabel
    --- PASS: TestReconcileMasterAddsControlPlaneLabel (0.20s)
    --- PASS: TestReconcileMasterSkipsExternalTopology (0.20s)
    PASS
    ok  	github.com/openshift/machine-config-operator/pkg/controller/node	1.267s
    

    go test ./pkg/controller/node/... -count=1
    ok  	github.com/openshift/machine-config-operator/pkg/controller/node	2.630s
    

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    Bug Fixes
    Improved node controller efficiency by skipping unnecessary reconciliation steps for external topology cluster configurations.
    Fixed control plane label management to occur only after topology verification.

    Tests
    Added test coverage for node reconciliation behavior across different cluster topology modes.
    Added test validation for simultaneous off-cluster and on-cluster machine configuration layering.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 342 lines (+256 / -86) across 4 files Reviewer: PoornimaSingour Review duration: 213211m
    All Vouch review confidence checks passed
    Residual risk 0.40 = Change Risk (0.72) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.72 · 342 lines diff across 4 files
    0.72
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    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.349
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.072
    Real PR Conversation Timeline
    1 comments
    "Review active on #6205"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 44.7% 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: 72.5% (HIGH) · Higher = larger blast radius
    72.5%
    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: 44.7% · Lower = rushed or shallow review
    44.7%
    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: 40.1% · Moderate risk
    40.1%