Skip to content

Commit f328088

Browse files
committed
add optional ns to wait_for_init
1 parent 6f9bc68 commit f328088

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
@@ -284,9 +284,10 @@ def wait_for_pod_ready(name, namespace, timeout=300):
284284
return False
285285

286286

287-
def wait_for_init(pod_name, timeout=300):
287+
def wait_for_init(pod_name, timeout=300, namespace: Optional[str] = None):
288+
if not namespace:
289+
namespace = get_default_namespace()
288290
sclient = get_static_client()
289-
namespace = get_default_namespace()
290291
w = watch.Watch()
291292
for event in w.stream(
292293
sclient.list_namespaced_pod, namespace=namespace, timeout_seconds=timeout

0 commit comments

Comments
 (0)