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 ac65cb8 commit d8d4405Copy full SHA for d8d4405
src/warnet/k8s.py
@@ -33,6 +33,22 @@ def get_dynamic_client() -> DynamicClient:
33
return DynamicClient(client.ApiClient())
34
35
36
+def kexec(pod: str, namespace: str, cmd: [str]) -> str:
37
+ """It's `kubectl exec` but with a k at the beginning so as not to conflict with python's `exec`"""
38
+ sclient = get_static_client()
39
+ resp = stream(
40
+ sclient.connect_get_namespaced_pod_exec,
41
+ pod,
42
+ namespace,
43
+ command=cmd,
44
+ stderr=True,
45
+ stdin=False,
46
+ stdout=True,
47
+ tty=False,
48
+ )
49
+ return resp
50
+
51
52
def get_pods() -> V1PodList:
53
sclient = get_static_client()
54
try:
0 commit comments