88from rich .text import Text
99from urllib3 .exceptions import MaxRetryError
1010
11- from .constants import COMMANDER_MISSION , TANK_MISSION
11+ from .constants import COMMANDER_MISSION , LIGHTNING_MISSION , TANK_MISSION
1212from .k8s import get_mission
1313from .network import _connected
1414
@@ -20,6 +20,7 @@ def status():
2020
2121 try :
2222 tanks = _get_tank_status ()
23+ lns = _get_ln_status ()
2324 scenarios = _get_deployed_scenarios ()
2425 except ConfigException as e :
2526 print (e )
@@ -52,6 +53,13 @@ def status():
5253 for tank in tanks :
5354 table .add_row ("Tank" , tank ["name" ], tank ["status" ], tank ["namespace" ])
5455
56+ # Add a separator if there are both tanks and scenarios
57+ if tanks and lns :
58+ table .add_row ("" , "" , "" )
59+
60+ for ln in lns :
61+ table .add_row ("Lightning" , ln ["name" ], ln ["status" ], ln ["namespace" ])
62+
5563 # Add a separator if there are both tanks and scenarios
5664 if tanks and scenarios :
5765 table .add_row ("" , "" , "" )
@@ -98,6 +106,18 @@ def _get_tank_status():
98106 ]
99107
100108
109+ def _get_ln_status ():
110+ tanks = get_mission (LIGHTNING_MISSION )
111+ return [
112+ {
113+ "name" : tank .metadata .name ,
114+ "status" : tank .status .phase .lower (),
115+ "namespace" : tank .metadata .namespace ,
116+ }
117+ for tank in tanks
118+ ]
119+
120+
101121def _get_deployed_scenarios ():
102122 commanders = get_mission (COMMANDER_MISSION )
103123 return [
0 commit comments