From 96b49cb4915894648002a2be0fe853146c2356a0 Mon Sep 17 00:00:00 2001 From: Preetha Appan Date: Mon, 19 Mar 2018 18:06:15 -0500 Subject: [PATCH] Hide the number of reschedule attempts for unlimited rescheduling --- command/alloc_status.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/command/alloc_status.go b/command/alloc_status.go index 77455cdeb..7abaffcbc 100644 --- a/command/alloc_status.go +++ b/command/alloc_status.go @@ -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,