Skip to content

Commit 336422f

Browse files
committed
delete_namespace: removed kubectl
1 parent 07127f4 commit 336422f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/warnet/k8s.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,10 @@ def apply_kubernetes_yaml_obj(yaml_obj: str) -> None:
148148
Path(temp_file_path).unlink()
149149

150150

151-
def delete_namespace(namespace: str) -> bool:
152-
command = f"kubectl delete namespace {namespace} --ignore-not-found"
153-
return run_command(command)
151+
def delete_namespace(namespace: str) -> V1Status:
152+
v1: CoreV1Api = get_static_client()
153+
resp = v1.delete_namespace(namespace)
154+
return resp
154155

155156

156157
def delete_pod(pod_name: str) -> bool:

0 commit comments

Comments
 (0)