We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
kexec
1 parent 08d29c0 commit ddc6d4fCopy full SHA for ddc6d4f
src/warnet/k8s.py
@@ -27,6 +27,22 @@ def get_dynamic_client() -> DynamicClient:
27
return DynamicClient(client.ApiClient())
28
29
30
+def kexec(pod: str, namespace: str, cmd: [str]) -> str:
31
+ """It's `kubectl exec` but with a k at the beginning so as not to conflict with python's `exec`"""
32
+ sclient = get_static_client()
33
+ resp = stream(
34
+ sclient.connect_get_namespaced_pod_exec,
35
+ pod,
36
+ namespace,
37
+ command=cmd,
38
+ stderr=True,
39
+ stdin=False,
40
+ stdout=True,
41
+ tty=False,
42
+ )
43
+ return resp
44
+
45
46
def get_pods() -> V1PodList:
47
sclient = get_static_client()
48
try:
0 commit comments