From 3c194bd2a4fb4693deba366b3400c2efeeb90369 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Wed, 29 Jun 2016 17:40:34 +0200 Subject: [PATCH] Fix --filter=desired_state behaviour Just like `docker service tasks`, we should add `desired_state` filters only in case there is no provided filters. Signed-off-by: Vincent Demeester --- api/client/node/tasks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/client/node/tasks.go b/api/client/node/tasks.go index 0c044e3dd6..8d45bc743d 100644 --- a/api/client/node/tasks.go +++ b/api/client/node/tasks.go @@ -55,7 +55,7 @@ func runTasks(dockerCli *client.DockerCli, opts tasksOptions) error { filter := opts.filter.Value() filter.Add("node", node.ID) - if !opts.all { + if !opts.all && !filter.Include("desired_state") { filter.Add("desired_state", string(swarm.TaskStateRunning)) filter.Add("desired_state", string(swarm.TaskStateAccepted))