daemon/cluster: inline filters
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
da8e07edb5
commit
d8b784a15e
2 changed files with 6 additions and 8 deletions
|
@ -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)),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue