File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 21
21
delete_pod ,
22
22
get_default_namespace ,
23
23
get_mission ,
24
+ get_pod ,
24
25
get_pods ,
25
26
pod_log ,
26
27
snapshot_bitcoin_datadir ,
@@ -329,7 +330,15 @@ def _logs(pod_name: str, follow: bool):
329
330
return # cancelled by user
330
331
331
332
try :
332
- stream = pod_log (pod_name , container_name = None , follow = follow )
333
+ pod = get_pod (pod_name )
334
+ container_names = [container .name for container in pod .spec .containers ]
335
+ container_name = container_names [0 ]
336
+ except Exception as e :
337
+ print (f"Could not determine primary container: { e } " )
338
+ return
339
+
340
+ try :
341
+ stream = pod_log (pod_name , container_name = container_name , follow = follow )
333
342
for line in stream .stream ():
334
343
print (line .decode ("utf-8" ), end = None )
335
344
except Exception as e :
You can’t perform that action at this time.
0 commit comments