Skip to content

Commit 51e82bb

Browse files
authored
Merge pull request #16 from westbrook-ai/fix-k8s-errored-terminals
fix: auto-recover errored terminal CRs in operator backend
2 parents aa61c5f + 22bddc0 commit 51e82bb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

terminals/backends/kubernetes_operator.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,12 @@ async def ensure_terminal(
533533
status = cr.get("status") or {}
534534
phase = status.get("phase")
535535

536-
if phase == "Idle":
536+
if phase in ("Idle", "Error"):
537+
log.info(
538+
"Terminal CR %s in phase %s — deleting and re-provisioning",
539+
cr["metadata"]["name"],
540+
phase,
541+
)
537542
await self._delete_terminal_cr(user_id, policy_id)
538543
return await self.provision(user_id, policy_id=policy_id, spec=spec)
539544

0 commit comments

Comments
 (0)