Skip to content

Commit 0055ccf

Browse files
committed
add optional ns to delete_pod
1 parent d63e771 commit 0055ccf

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
@@ -128,8 +128,10 @@ def delete_namespace(namespace: str) -> bool:
128128
return run_command(command)
129129

130130

131-
def delete_pod(pod_name: str) -> bool:
132-
command = f"kubectl -n {get_default_namespace()} delete pod {pod_name}"
131+
def delete_pod(pod_name: str, namespace: Optional[str] = None) -> bool:
132+
if not namespace:
133+
namespace = get_default_namespace()
134+
command = f"kubectl -n {namespace} delete pod {pod_name}"
133135
return stream_command(command)
134136

135137

0 commit comments

Comments
 (0)