Skip to content

Commit b39b666

Browse files
committed
add optional ns to write_file_to_container
1 parent 28ad860 commit b39b666

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
@@ -353,9 +353,12 @@ def wait_for_pod(pod_name, timeout_seconds=10, namespace: Optional[str] = None):
353353
timeout_seconds -= 1
354354

355355

356-
def write_file_to_container(pod_name, container_name, dst_path, data):
356+
def write_file_to_container(
357+
pod_name, container_name, dst_path, data, namespace: Optional[str] = None
358+
):
359+
if not namespace:
360+
namespace = get_default_namespace()
357361
sclient = get_static_client()
358-
namespace = get_default_namespace()
359362
exec_command = ["sh", "-c", f"cat > {dst_path}"]
360363
try:
361364
res = stream(

0 commit comments

Comments
 (0)