Skip to content

node condtion remediation#131

Open
runzhen wants to merge 15 commits intomainfrom
runzhen/npd3
Open

node condtion remediation#131
runzhen wants to merge 15 commits intomainfrom
runzhen/npd3

Conversation

@runzhen
Copy link
Copy Markdown
Collaborator

@runzhen runzhen commented Mar 21, 2026

  • check the node condition, and reboot the node if needed.
  • merge the remediation code with the existing drift remediation loop.

Copilot AI review requested due to automatic review settings March 21, 2026 01:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds “node reboot required” detection/remediation by surfacing a reboot-needed signal in the status snapshot, turning it into a drift finding, and introducing a reboot remediation action.

Changes:

  • Extend status.NodeStatus with a NeedReboot flag and populate it during status collection by inspecting the node’s KernelDeadlock condition.
  • Add a new drift detector (RebootDetector) that emits a reboot finding when NeedReboot is true.
  • Add a new drift remediation action (reboot) that triggers a system reboot via systemctl, plus unit tests for the detector.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/status/types.go Adds NeedReboot to the persisted node status schema.
pkg/status/collector.go Computes NeedReboot by reading boot time and querying node conditions.
pkg/drift/detector.go Introduces RemediationActionReboot.
pkg/drift/defaults.go Registers RebootDetector in default detector set.
pkg/drift/node_reboot.go New detector that converts NeedReboot into a drift finding/remediation plan.
pkg/drift/node_reboot_test.go Unit tests for reboot detector behavior.
pkg/drift/remediation.go Adds reboot remediation runner that invokes systemctl reboot.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 21, 2026 01:17
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 23, 2026 22:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 23, 2026 22:47
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

@runzhen I've opened a new pull request, #134, to work on those changes. Once the pull request is ready, I'll request review from you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants