File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
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
10
- from kubernetes .client .models import CoreV1Event , V1PodList
11
+ from kubernetes .client .models import CoreV1Event , V1Pod , V1PodList
11
12
from kubernetes .client .rest import ApiException
12
13
from kubernetes .dynamic import DynamicClient
13
14
from kubernetes .stream import stream
@@ -41,6 +42,13 @@ def get_pods() -> V1PodList:
41
42
return pod_list
42
43
43
44
45
+ def get_pod (name : str , namespace : Optional [str ] = None ) -> V1Pod :
46
+ sclient = get_static_client ()
47
+ if not namespace :
48
+ namespace = get_default_namespace ()
49
+ return sclient .read_namespaced_pod (name = name , namespace = namespace )
50
+
51
+
44
52
def get_mission (mission : str ) -> list [V1PodList ]:
45
53
pods = get_pods ()
46
54
crew = []
You can’t perform that action at this time.
0 commit comments