From 596e970fb7ba98e4e867d649999930aec2fdc62a Mon Sep 17 00:00:00 2001 From: "juvenal.diaz" Date: Mon, 2 Nov 2026 21:24:58 -0600 Subject: [PATCH] Check disabled workloads and planned static volumes correctly --- lib/jeannie/pipeline.sh | 4 ++-- scripts/scheduling-preflight.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/jeannie/pipeline.sh b/lib/jeannie/pipeline.sh index ca86902..6bb06f3 100644 --- a/lib/jeannie/pipeline.sh +++ b/lib/jeannie/pipeline.sh @@ -1081,8 +1081,8 @@ run_tofu_stack() { ensure_platform_scheduling_labels || return 1 fi - tofu -chdir="${REPO_ROOT}/${stack}" init - ensure_kubernetes_api_ready_for_tofu_stack "${stack}" + tofu -chdir="${REPO_ROOT}/${stack}" init || return 1 + ensure_kubernetes_api_ready_for_tofu_stack "${stack}" || return 1 if [[ "${stack}" == "bootstrap/platform" ]]; then configure_platform_metrics_server_ownership || return 1 fi diff --git a/scripts/scheduling-preflight.py b/scripts/scheduling-preflight.py index 45a18ae..b482587 100644 --- a/scripts/scheduling-preflight.py +++ b/scripts/scheduling-preflight.py @@ -396,6 +396,12 @@ class Estimate: old = [p for p in self.pods if self.owner(p) == (kind, namespace, name)] live = self.controllers.get((kind, namespace, name), {}) desired = spec.get("replicas", 1) + if kind in ("Deployment", "StatefulSet") and desired == 0: + # A disabled workload creates no incoming Pods and does not need + # rollout surge/unavailability or an eligible node. Keep any old + # reservations until live termination is observed. + print(f" DISABLED {kind} {namespace}/{name}: zero desired replicas") + return status = live.get("status", {}) stable = status.get("observedGeneration", 0) >= live.get("metadata", {}).get("generation", 1) stable = stable and status.get("readyReplicas", 0) >= desired and status.get("updatedReplicas", 0) >= desired @@ -677,6 +683,10 @@ def main(): if item["kind"] == "PersistentVolumeClaim": key = item["metadata"]["namespace"], item["metadata"]["name"] engine.pvcs.setdefault(key, item) + elif item["kind"] == "PersistentVolume": + # Static PVs can be introduced by the same GitOps application as + # their claims. Live PVs remain authoritative for existing data. + engine.pvs.setdefault(item["metadata"]["name"], item) elif item["kind"] == "StorageClass": engine.storage_classes[item["metadata"]["name"]] = item workloads = {identity(d): d for d in documents if d["kind"] in ("Deployment", "StatefulSet", "DaemonSet", "Pod")}