From f9cb0563ec8da1b30472be5852dbd5245a2bd91b Mon Sep 17 00:00:00 2001 From: Aaron Lehmann Date: Fri, 23 Jun 2017 17:34:59 -0700 Subject: [PATCH] progress: Show progress of replicated tasks before they are assigned This was only showing tasks that belong to nodes that are currently up, so that tasks on down nodes don't appear to be stuck. But this unintentionally excludes tasks that haven't been assigned yet, so if a task is stuck before assignment, for example because no nodes meet its constraints, a progress bar won't even be shown. The check should only apply to tasks that have a node assignment. Signed-off-by: Aaron Lehmann (cherry picked from commit d3d09f67b18673ec457c5f6634d346a937c58728) Signed-off-by: Andrew Hsu --- components/cli/cli/command/service/progress/progress.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/cli/cli/command/service/progress/progress.go b/components/cli/cli/command/service/progress/progress.go index 88cc9e5facb..b772a61419e 100644 --- a/components/cli/cli/command/service/progress/progress.go +++ b/components/cli/cli/command/service/progress/progress.go @@ -275,7 +275,11 @@ func (u *replicatedProgressUpdater) update(service swarm.Service, tasks []swarm. continue } } - if _, nodeActive := activeNodes[task.NodeID]; nodeActive { + if task.NodeID != "" { + if _, nodeActive := activeNodes[task.NodeID]; nodeActive { + tasksBySlot[task.Slot] = task + } + } else { tasksBySlot[task.Slot] = task } }