Skip to content

Commit 4ffa93b

Browse files
committed
add namespace to status
1 parent 23ed173 commit 4ffa93b

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

src/warnet/status.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ def status():
4545
table.add_column("Component", style="cyan")
4646
table.add_column("Name", style="green")
4747
table.add_column("Status", style="yellow")
48+
table.add_column("Namespace", style="green")
4849

4950
# Add tanks to the table
5051
for tank in tanks:
51-
table.add_row("Tank", tank["name"], tank["status"])
52+
table.add_row("Tank", tank["name"], tank["status"], tank["namespace"])
5253

5354
# Add a separator if there are both tanks and scenarios
5455
if tanks and scenarios:
@@ -58,7 +59,7 @@ def status():
5859
active = 0
5960
if scenarios:
6061
for scenario in scenarios:
61-
table.add_row("Scenario", scenario["name"], scenario["status"])
62+
table.add_row("Scenario", scenario["name"], scenario["status"], scenario["namespace"])
6263
if scenario["status"] == "running" or scenario["status"] == "pending":
6364
active += 1
6465
else:
@@ -86,9 +87,23 @@ def status():
8687

8788
def _get_tank_status():
8889
tanks = get_mission("tank")
89-
return [{"name": tank.metadata.name, "status": tank.status.phase.lower()} for tank in tanks]
90+
return [
91+
{
92+
"name": tank.metadata.name,
93+
"status": tank.status.phase.lower(),
94+
"namespace": tank.metadata.namespace,
95+
}
96+
for tank in tanks
97+
]
9098

9199

92100
def _get_deployed_scenarios():
93101
commanders = get_mission("commander")
94-
return [{"name": c.metadata.name, "status": c.status.phase.lower()} for c in commanders]
102+
return [
103+
{
104+
"name": c.metadata.name,
105+
"status": c.status.phase.lower(),
106+
"namespace": c.metadata.namespace,
107+
}
108+
for c in commanders
109+
]

0 commit comments

Comments
 (0)