From e6f702014f43f28314c533c273fbf33f09436b81 Mon Sep 17 00:00:00 2001 From: Dong Chen Date: Sat, 17 Dec 2016 13:44:35 -0800 Subject: [PATCH] Global orchestrator reconcileServices should look at desired state to avoid adding multiple tasks. Signed-off-by: Dong Chen --- manager/orchestrator/global/global.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/orchestrator/global/global.go b/manager/orchestrator/global/global.go index 28c2a436d3..c08f0eb46d 100644 --- a/manager/orchestrator/global/global.go +++ b/manager/orchestrator/global/global.go @@ -504,7 +504,7 @@ func (g *Orchestrator) removeTasks(ctx context.Context, batch *store.Batch, task } func isTaskRunning(t *api.Task) bool { - return t != nil && t.DesiredState <= api.TaskStateRunning && t.Status.State <= api.TaskStateRunning + return t != nil && t.DesiredState <= api.TaskStateRunning } func isTaskCompleted(t *api.Task, restartPolicy api.RestartPolicy_RestartCondition) bool {