Skip to content

Commit af8ca0f

Browse files
committed
k8s: add optional ns to delete_pod
1 parent 7783990 commit af8ca0f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/warnet/k8s.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ def delete_namespace(namespace: str) -> bool:
135135
return run_command(command)
136136

137137

138-
def delete_pod(pod_name: str) -> bool:
139-
command = f"kubectl -n {get_default_namespace()} delete pod {pod_name}"
138+
def delete_pod(pod_name: str, namespace: Optional[str] = None) -> bool:
139+
if not namespace:
140+
namespace = get_default_namespace()
141+
command = f"kubectl -n {namespace} delete pod {pod_name}"
140142
return stream_command(command)
141143

142144

0 commit comments

Comments
 (0)