Merge pull request #16 from westbrook-ai/fix-k8s-errored-terminals

fix: auto-recover errored terminal CRs in operator backend
This commit is contained in:
Tim Baek authored and GitHub committed 2026-04-01 10:06:29 +04:00
commit 51e82bb9a5
1 file changed
+6 -1
+6 -1
View File
@@ -533,7 +533,12 @@ class KubernetesOperatorBackend(Backend):
status = cr.get("status") or {}
phase = status.get("phase")
if phase == "Idle":
if phase in ("Idle", "Error"):
log.info(
"Terminal CR %s in phase %s — deleting and re-provisioning",
cr["metadata"]["name"],
phase,
)
await self._delete_terminal_cr(user_id, policy_id)
return await self.provision(user_id, policy_id=policy_id, spec=spec)