diff --git a/daemon/cluster/executor/container/container.go b/daemon/cluster/executor/container/container.go index 9fb28e0d94..a4d341ef78 100644 --- a/daemon/cluster/executor/container/container.go +++ b/daemon/cluster/executor/container/container.go @@ -717,9 +717,9 @@ func (c *containerConfig) applyPrivileges(hc *enginecontainer.HostConfig) { } func (c containerConfig) eventFilter() filters.Args { - filter := filters.NewArgs() - filter.Add("type", events.ContainerEventType) - filter.Add("name", c.name()) - filter.Add("label", fmt.Sprintf("%v.task.id=%v", systemLabelPrefix, c.task.ID)) - return filter + return filters.NewArgs( + filters.Arg("type", events.ContainerEventType), + filters.Arg("name", c.name()), + filters.Arg("label", fmt.Sprintf("%v.task.id=%v", systemLabelPrefix, c.task.ID)), + ) } diff --git a/daemon/cluster/swarm.go b/daemon/cluster/swarm.go index 23478c8cd7..f358f89cc9 100644 --- a/daemon/cluster/swarm.go +++ b/daemon/cluster/swarm.go @@ -606,10 +606,8 @@ func initClusterSpec(node *swarmnode.Node, spec types.Spec) error { func (c *Cluster) listContainerForNode(ctx context.Context, nodeID string) ([]string, error) { var ids []string - filters := filters.NewArgs() - filters.Add("label", fmt.Sprintf("com.docker.swarm.node.id=%s", nodeID)) containers, err := c.config.Backend.Containers(ctx, &apitypes.ContainerListOptions{ - Filters: filters, + Filters: filters.NewArgs(filters.Arg("label", "com.docker.swarm.node.id="+nodeID)), }) if err != nil { return []string{}, err