fix: scope disk self-healing to Pimox targets

This commit is contained in:
juvenal.diaz 2026-10-27 10:47:59 -06:00
parent 7aeb50cbae
commit 6ec2bca208
1 changed files with 14 additions and 0 deletions

View File

@ -199,6 +199,20 @@ def handle_payload(payload: dict[str, Any], *, apply: bool) -> dict[str, Any]:
disk_command = disk_self_heal_command(payload, set(names))
api_command = api_self_heal_command(set(names))
direct_command = disk_command or api_command
# Disk alerts are deliberately target-specific. Do not fall through to
# the generic doctor/heal planner when the alert does not identify a
# Pimox node that Jeannie can clean safely. A generic heal action could
# clean stale pods while leaving the actual filesystem pressure untouched
# and would produce a misleading "applied" result.
if set(names) & DISK_SELF_HEAL_ALERTS and not disk_command and not api_command:
result = {
"status": "skipped",
"reason": "disk alert target is not a recognized Pimox node",
"alerts": names,
"audit_dir": str(audit_dir),
}
write_text(audit_dir / "result.json", json.dumps(result, indent=2, sort_keys=True) + "\n")
return result
if direct_command:
result = {
"status": "planned",