Skip to content

Commit 3cf6b72

Browse files
committed
k8s: add optional ns to write_file_to_container
1 parent 0172105 commit 3cf6b72

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/warnet/k8s.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,12 @@ def wait_for_pod(pod_name, timeout_seconds=10, namespace: Optional[str] = None):
360360
timeout_seconds -= 1
361361

362362

363-
def write_file_to_container(pod_name, container_name, dst_path, data):
363+
def write_file_to_container(
364+
pod_name, container_name, dst_path, data, namespace: Optional[str] = None
365+
):
366+
if not namespace:
367+
namespace = get_default_namespace()
364368
sclient = get_static_client()
365-
namespace = get_default_namespace()
366369
exec_command = ["sh", "-c", f"cat > {dst_path}"]
367370
try:
368371
res = stream(

0 commit comments

Comments
 (0)