Repository navigation
fix(scripts): keep the node re-read diagnostic when kubectl fails silently - #4057
Conversation
…ently When the node re-read after a refused cordon claim failed without writing stderr, the diagnostic file was zero bytes, so copying it succeeded while truncating the result file. The fallback line never fired, the empty file was skipped, and the operator saw a bare "Could not atomically claim and cordon" with no cause. An empty diagnostic now counts as a failed copy, exactly as the Flux parent re-read already does, so the deterministic fallback line is emitted. A non-empty diagnostic still reaches the operator verbatim. Fixes #3886 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Aut24ni8XbKPYyY5mYrbb
Evidence for head The fix is the one-line Tests addedThe fake kubectl now records a refused claim and can fail the next node re-read once, with or without stderr. Two tests use it:
Both first assert that the fixture really failed the re-read, via its marker file, so neither can pass because the path was never reached. RED / GREEN
Validation (CI's
|
@coderabbitai review Generated by Claude Code |
|
✅ Action performedReview finished.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details🔇 Additional comments (3)
📝 WalkthroughWalkthroughWhen a node re-read fails, the claim path now writes a fallback diagnostic if captured stderr is empty or cannot be copied. The fake kubectl fixture can simulate silent and diagnostic-producing failures. New tests check that both diagnostic cases reach output and that node draining does not run after the failed claim. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The node re-read failure should now report a diagnostic even when kubectl is silent. No actionable issue remains in the supplied review evidence. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Resolution record for CodeRabbit's pre-merge Docstring Coverage warning at head The count is a generic 80% threshold over the seven functions the diff touches. It is not a convention in this repository. Both new tests already open with a comment explaining the scenario and why it matters, and so does the changed shell function. The functions the metric counts as missing are the existing fake-kubectl dispatchers ( Generated by Claude Code |
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review Generated by Claude Code |
|
|
@coderabbitai full review |
|
✅ Action performedFull review finished. |
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Why
A production rollout stops when it cannot safely take a node out of service. When the check that re-reads the node failed without printing an error, the operator was told the node could not be claimed but not why. That happens when the cluster API is unhealthy, which is when the reason matters most.
What
A silent failure now produces a clear fallback message saying the node re-read failed. A real error message from the cluster is still passed through unchanged. This matches how the equivalent Flux check already behaves.
Fixes #3886
🤖 Generated with Claude Code
https://claude.ai/code/session_011Aut24ni8XbKPYyY5mYrbb
Generated by Claude Code