fix: scope disk self-healing to Pimox targets
This commit is contained in:
parent
7aeb50cbae
commit
6ec2bca208
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in New Issue