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 <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2016-06-29 17:40:34 +02:00
parent 3d231c78e8
commit 3c194bd2a4
No known key found for this signature in database
GPG key ID: 083CC6FD6EB699A3

View file

@ -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))