Skip to content

Commit

Permalink
fix(cdsctl): fix potential panic (#3233)
Browse files Browse the repository at this point in the history
Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com>
  • Loading branch information
yesnault authored and bnjjj committed Aug 21, 2018
1 parent e3b8d90 commit ef009ef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli/cdsctl/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ func (ui *Termui) computeStatusHatcheriesWorkers(workers []sdk.Worker) {
} else {
name = w.HatcheryName
}
if _, ok := hatcheries[name]; !ok {
hatcheries[name] = make(map[string]int64)
hatcheryNames = append(hatcheryNames, name)
}
hatcheries[name][w.Status.String()] = hatcheries[name][w.Status.String()] + 1
if _, ok := status[w.Status.String()]; !ok {
statusTitle = append(statusTitle, w.Status.String())
Expand Down

0 comments on commit ef009ef

Please sign in to comment.