Skip to content

Commit 5954432

Browse files
committed
k8s: add optional ns to wait_for_init
1 parent 7834f13 commit 5954432

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/warnet/k8s.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,10 @@ def wait_for_pod_ready(name, namespace, timeout=300):
291291
return False
292292

293293

294-
def wait_for_init(pod_name, timeout=300):
294+
def wait_for_init(pod_name, timeout=300, namespace: Optional[str] = None):
295+
if not namespace:
296+
namespace = get_default_namespace()
295297
sclient = get_static_client()
296-
namespace = get_default_namespace()
297298
w = watch.Watch()
298299
for event in w.stream(
299300
sclient.list_namespaced_pod, namespace=namespace, timeout_seconds=timeout

0 commit comments

Comments
 (0)