File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 4
4
import tempfile
5
5
from pathlib import Path
6
6
from time import sleep
7
+ from typing import Optional
7
8
8
9
import yaml
9
10
from kubernetes import client , config , watch
@@ -58,10 +59,12 @@ def get_mission(mission: str) -> list[V1Pod]:
58
59
return crew
59
60
60
61
61
- def get_pod_exit_status (pod_name ):
62
+ def get_pod_exit_status (pod_name , namespace : Optional [str ] = None ):
63
+ if not namespace :
64
+ namespace = get_default_namespace ()
62
65
try :
63
66
sclient = get_static_client ()
64
- pod = sclient .read_namespaced_pod (name = pod_name , namespace = get_default_namespace () )
67
+ pod = sclient .read_namespaced_pod (name = pod_name , namespace = namespace )
65
68
for container_status in pod .status .container_statuses :
66
69
if container_status .state .terminated :
67
70
return container_status .state .terminated .exit_code
You can’t perform that action at this time.
0 commit comments