Skip to content

Commit 7783990

Browse files
committed
k8s: add optional ns to get_pod_exit_stats
1 parent a46f1c2 commit 7783990

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/warnet/k8s.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,12 @@ def get_mission(mission: str) -> list[V1Pod]:
6666
return crew
6767

6868

69-
def get_pod_exit_status(pod_name):
69+
def get_pod_exit_status(pod_name, namespace: Optional[str] = None):
70+
if not namespace:
71+
namespace = get_default_namespace()
7072
try:
7173
sclient = get_static_client()
72-
pod = sclient.read_namespaced_pod(name=pod_name, namespace=get_default_namespace())
74+
pod = sclient.read_namespaced_pod(name=pod_name, namespace=namespace)
7375
for container_status in pod.status.container_statuses:
7476
if container_status.state.terminated:
7577
return container_status.state.terminated.exit_code

0 commit comments

Comments
 (0)