← Back to Pull requests

OCPBUGS-135360: [release-4.21] Fix stale MachineOSBuild annotation preventing pool updates #6703

Closed
unknown closed this pull request without merging on Nov 05, 2026 21:58 UTC
View on GitHub
unknown unknown commented on Oct 30, 2026 16:37 UTC
Author

What type of PR is this?
/kind bug

What this PR does / why we need it:
This is a backport of #5878 to release-4.21.

When a MachineOSConfig's current-machine-os-build annotation points to:
1. A build for an old rendered config (annotation is stale), OR
2. A build that no longer exists (deleted/pruned)

The node controller would log warnings but not clear the annotation.
This prevented the build controller from creating a new build for the
current rendered config, causing pools to get stuck at 0 machines
configured with the error 'Image is not ready yet'.

Why this backport is needed for 4.21:
OCP-82536 (OCB internal-registry rebuild test) has been failing on every 4.21 nightly run since July, but passes fine
on 4.22/5.0/5.1. Latest failing job:
https://qe-private-deck-ci.apps.ci.l2s4.p1.openshiftapps.com/view/gs/test-platform-results/pr-logs/pull/openshift_relea
se/61985/periodic-ci-openshift-release-master-nightly-4.21-e2e-metal-ipi-ovn-ipv6/2115048879652081664

Fix:

  • Node controller: actively clear the stale annotation when detected

  • Build controller: always call reconcileImageRebuild() to correctly

  • determine if a change is layer-only vs full rebuild, even when
    annotation is missing. This avoids forcing unnecessary image rebuilds
    for layer-only changes when annotation was cleared.

    This allows the build controller to see the annotation is missing and
    trigger creation of the correct type of MachineOSBuild for the current
    rendered config.

    Which issue(s) this PR fixes:
    Fixes: OCPBUGS-135359

    Special notes for your reviewer:
    Original PR: #5878
    Cherry-picked from: 547549756acc1ad76f6017ac34a1357668a65deb

    Conflicts were resolved in:

  • pkg/controller/build/reconciler.go - Merged the logic for handling missing annotations

  • test/e2e-ocl-2of2/onclusterlayering_test.go - Added the new test case
  • Diff: 238 lines (+178 / -60) across 2 files Reviewer: yuqi-zhang Review duration: 8961m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 238 lines diff across 2 files
    0.37
    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.328
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6703"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 37.2% (MEDIUM) · Higher = larger blast radius
    37.2%
    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: 14.7% · Safe to merge
    14.7%