From 5c2d91ab84cbf812b8a0cf390a715ba507858efb Mon Sep 17 00:00:00 2001 From: yshay Date: Thu, 16 Mar 2017 16:38:40 +0200 Subject: [PATCH] Add check on task status in addition to desired status --- provider/docker.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/provider/docker.go b/provider/docker.go index 4d15c4faa..408e21b0a 100644 --- a/provider/docker.go +++ b/provider/docker.go @@ -828,6 +828,9 @@ func listTasks(ctx context.Context, dockerClient client.APIClient, serviceID str var dockerDataList []dockerData for _, task := range taskList { + if task.Status.State != swarm.TaskStateRunning { + continue + } dockerData := parseTasks(task, serviceDockerData, networkMap, isGlobalSvc) dockerDataList = append(dockerDataList, dockerData) }