Skip to content

Commit 5475d34

Browse files
committed
delete_namespace: removed kubectl
1 parent 196eb48 commit 5475d34

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
@@ -142,9 +142,10 @@ def apply_kubernetes_yaml_obj(yaml_obj: str) -> None:
142142
Path(temp_file_path).unlink()
143143

144144

145-
def delete_namespace(namespace: str) -> bool:
146-
command = f"kubectl delete namespace {namespace} --ignore-not-found"
147-
return run_command(command)
145+
def delete_namespace(namespace: str) -> V1Status:
146+
v1: CoreV1Api = get_static_client()
147+
resp = v1.delete_namespace(namespace)
148+
return resp
148149

149150

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

0 commit comments

Comments
 (0)