Skip to content

Commit

Permalink
diagnostics: updated stage cmd to support substages (#10645)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvovk authored Jun 10, 2024
1 parent 53c817b commit 664cc98
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/diag/stages/stages.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func printCurentStage(cliCtx *cli.Context) error {
case "text":
util.RenderTableWithHeader(
"Sync stages:",
table.Row{"Stage", "Status"},
table.Row{"Stage", "SubStage", "Status"},
stagesRows,
)
}
Expand All @@ -60,18 +60,23 @@ func getStagesRows(stages []diagnostics.SyncStage) []table.Row {
for _, stage := range stages {
stageRow := table.Row{
stage.ID,
"",
stage.State.String(),
}
rows = append(rows, stageRow)

for _, substage := range stage.SubStages {
subStageRow := table.Row{
"",
substage.ID,
substage.State.String(),
}
rows = append(rows, subStageRow)
}

rows = append(rows, stageRow)
if len(stage.SubStages) != 0 {
rows = append(rows, table.Row{"", "", ""})
}
}

return rows
Expand Down

0 comments on commit 664cc98

Please sign in to comment.