From e0e22308b0334fb9d605496184c146c514c1d408 Mon Sep 17 00:00:00 2001 From: "juvenal.diaz" Date: Tue, 27 Oct 2026 12:05:48 -0600 Subject: [PATCH] fix: disable Debian disk self-healing --- scripts/jeannie-eventd | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/jeannie-eventd b/scripts/jeannie-eventd index ee46a88..fb10269 100755 --- a/scripts/jeannie-eventd +++ b/scripts/jeannie-eventd @@ -46,6 +46,17 @@ DISK_SELF_HEAL_ALERTS = { "FreeDiskSpaceFailed", } +# Debian is intentionally monitored but excluded from automatic disk cleanup: +# its constrained root/data layout has no safe generic deletion target. Keep +# this list explicit so adding another host cannot accidentally enable cleanup. +DISK_SELF_HEAL_DISABLED_HOSTS = { + item.strip().lower() + for item in os.environ.get( + "LAB_DISK_SELF_HEAL_DISABLED_HOSTS", "debian,debian-lab,debian-2" + ).split(",") + if item.strip() +} + def prom_escape(value: object) -> str: text = str(value) @@ -120,6 +131,19 @@ def disk_self_heal_command(payload: dict[str, Any], names: set[str]) -> list[str labels_list.append(common_labels) for labels in labels_list: + host_values = ( + labels.get("node"), + labels.get("hostname"), + labels.get("host"), + labels.get("instance"), + ) + normalized_hosts = { + str(value).split(":", 1)[0].lower() + for value in host_values + if value + } + if normalized_hosts & DISK_SELF_HEAL_DISABLED_HOSTS: + return None node = str(labels.get("node") or "") if re.fullmatch(r"pimox-cp(?:-\d+)?", node): return ["./jeannie", "workers", "disk-cleanup", "control-plane", "--yes"]