Skip to content

Commit

Permalink
Merge pull request #4006 from hashicorp/b-alloc-status-cli-hide-unlim…
Browse files Browse the repository at this point in the history
…ited-attempts

Hide the number of reschedule attempts for unlimited rescheduling
  • Loading branch information
Preetha authored Mar 19, 2018
2 parents 61d8ce1 + 55d17cf commit 87865ce
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions command/alloc_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,11 @@ func formatAllocBasicInfo(alloc *api.Allocation, client *api.Client, uuidLength

if alloc.RescheduleTracker != nil && len(alloc.RescheduleTracker.Events) > 0 {
attempts, total := alloc.RescheduleInfo(time.Unix(0, alloc.ModifyTime))
reschedInfo := fmt.Sprintf("Reschedule Attempts|%d/%d", attempts, total)
basic = append(basic, reschedInfo)
// Show this section only if the reschedule policy limits the number of attempts
if total > 0 {
reschedInfo := fmt.Sprintf("Reschedule Attempts|%d/%d", attempts, total)
basic = append(basic, reschedInfo)
}
}
if alloc.NextAllocation != "" {
basic = append(basic,
Expand Down

0 comments on commit 87865ce

Please sign in to comment.