Skip to content

Commit

Permalink
Add unknown to TaskGroupSummary (#12269)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekStrickland authored Mar 14, 2022
1 parent 0dd270c commit 13e14ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions api/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,7 @@ type TaskGroupSummary struct {
Running int
Starting int
Lost int
Unknown int
}

// JobListStub is used to return a subset of information about
Expand Down
6 changes: 3 additions & 3 deletions command/job_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,18 +540,18 @@ func (c *JobStatusCommand) outputJobSummary(client *api.Client, job *api.Job) er
if !periodic && !parameterizedJob {
c.Ui.Output(c.Colorize().Color("\n[bold]Summary[reset]"))
summaries := make([]string, len(summary.Summary)+1)
summaries[0] = "Task Group|Queued|Starting|Running|Failed|Complete|Lost"
summaries[0] = "Task Group|Queued|Starting|Running|Failed|Complete|Lost|Unknown"
taskGroups := make([]string, 0, len(summary.Summary))
for taskGroup := range summary.Summary {
taskGroups = append(taskGroups, taskGroup)
}
sort.Strings(taskGroups)
for idx, taskGroup := range taskGroups {
tgs := summary.Summary[taskGroup]
summaries[idx+1] = fmt.Sprintf("%s|%d|%d|%d|%d|%d|%d",
summaries[idx+1] = fmt.Sprintf("%s|%d|%d|%d|%d|%d|%d|%d",
taskGroup, tgs.Queued, tgs.Starting,
tgs.Running, tgs.Failed,
tgs.Complete, tgs.Lost,
tgs.Complete, tgs.Lost, tgs.Unknown,
)
}
c.Ui.Output(formatList(summaries))
Expand Down

0 comments on commit 13e14ac

Please sign in to comment.