fix(janitor-provider): skip generic reboot when the node boot ID has changed #2110
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 475 lines diff across 5 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.369
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2110"
general
weight: 0.35
jtschelling
Summary
Fixes #2077.
With
CSP=generic, one reboot request can reboot a node twice. The reboot kills the reboot pod before the kubelet reports a terminal status. After boot, the kubelet starts the same pod again, and that pod reboots the node a second time.restartPolicy: NeverandbackoffLimit: 0do not prevent this, andcleanupRebootJobraces with the kubelet.This change makes each reboot Job valid only for the boot that created it:
SendRebootSignalpasses the pre-reboot boot ID to the container in thePRE_REBOOT_BOOT_IDenv var.sh -cand start with a boot ID check. The check compares/proc/sys/kernel/random/boot_idwithPRE_REBOOT_BOOT_IDbefore any other action:- IDs match: write the optional syslog entry, then reboot. The reboot runs last, so a failed reboot exits non-zero.
- IDs differ: the node already rebooted. Log
skipping rebootand exit 0, with no reboot and no syslog entry.- Either ID missing or unreadable: exit 1 and do not reboot (fail closed).
if/theninstead of the issue'scheck && reboot || echo. With&&/||, a failed reboot prints "skipping" and exits 0, and an empty env var with an unreadable file reboots the node.No change to Helm values, protobufs, CRDs, labels or metrics. Jobs created by the previous version keep their old command until they finish.
Behaviour note for operators: the default reboot command changes from
chroot /host rebootto ash -cscript. The reboot image must includeshandcat. The defaultbusyboximage has both. If a custom image has nosh, the container does not start and the node does not reboot.Type of Change
Component(s) Affected
Testing
Cluster test on the dev cluster where #2077 was reproduced (
CSP=generic, default reboot command, CRI-O, node10.0.10.194). In both runs janitor-provider was on the rebooted node, so cleanup could not run before the kubelet restarted the reboot pod.| Run | Path | Boot ID | Kubelet re-ran reboot pod | Second run output | Result |
|---|---|---|---|---|---|
| 1 | RebootNode CR |
77d320c9…→25a1e7b8…| Yes, 19 s before Job cleanup |boot ID changed … skipping reboot, exit 0 | One reboot, stable 7 min || 2 | MaintenanceRequest (
RESTART_VM) |25a1e7b8…→59a165d3…| Yes, 20 s before Job cleanup |boot ID changed … skipping reboot, exit 0 | One reboot, stable 5 min; node uncordoned after the MaintenanceRequest was deleted |Checklist
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Reboot jobs now check the node’s boot ID before taking action. If the node has already rebooted, the job skips another reboot; if the boot ID cannot be read, it stops without rebooting.
Documentation
Updated provider guidance to clarify reboot image requirements and explain how reboot jobs behave after a node restarts.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->