OCPBUGS-105508: Re-apply MC /etc files after OS update to fix ostree 3-way merge overwrites #6409
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #6409"
general
weight: 0.35
yuqi-zhang
Closes: OCPBUGS-105508
- What I did
During version upgrades, the ostree merge can overwrite user defined overrides of managed files when their content matches the old OS base. After reboot, when the MCD validates on-disk state against the rendered MachineConfig, it marks the node
Degradedif the content does not match what is defined in the MC.With this change, when an OS update includes MC-managed /etc files, write a persistent marker at /etc/machine-config-daemon/post-os-update-etc-files before rebooting. On the next first-run,
checkStateOnFirstRun()detects the marker, re-applies all MC /etc files to the live filesystem before validation, then removes the marker. This corrects any overwrites the 3-way merge performed at boot time.- How to verify it
1. Launch a 4.21 cluster.
2. Apply a MC to set the content of
/etc/ssh/sshd_configand wait for the worker MCP to return to updated.3. Upgrade to a 4.22 release payload built with https://github.com/openshift/machine-config-operator/pull/6410, which is a 4.22 version of this fix.
_Note:_ I used Clusterbot to create the release payload:
build 4.22.0-0.nightly-2026-08-13-103840,openshift/machine-config-operator#64104. Ensure that the upgrade to 4.22 succeeds and that no nodes or MCPs degrade and check that the contents of
/etc/ssh/sshd_configmatch what is expected.- Description for the changelog
OCPBUGS-105508: Re-apply MC /etc files after OS update to fix ostree 3-way merge overwrites
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Bug Fixes
Ensured managed
/etcconfiguration files are reapplied after an operating system update when needed.Improved first-run validation to detect and recover configuration changes that may be overwritten during reboot.
Update processing now reports failures when post-update markers or managed files cannot be written.
* Avoided unnecessary post-update processing when no OS update or managed
/etcfiles are present.<!-- end of auto-generated comment: release notes by coderabbit.ai -->