Replace all "Filter" field with "Filters" for consistency
In file `api/types/client.go`, some of the "*Options{}" structs own a
`Filters` field while some else have the name of `Filter`, this commit
will rename all `Filter` to `Filters` for consistency. Also `Filters`
is consistent with API with format `/xxx?filters=xxx`, that's why
`Filters` is the right name.
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 89a6966726941b4b7f0431ab214013cf9c655c25
Component: engine
This commit is contained in:
@ -597,7 +597,7 @@ func (c *Cluster) listContainerForNode(nodeID string) ([]string, error) {
|
||||
filters := filters.NewArgs()
|
||||
filters.Add("label", fmt.Sprintf("com.docker.swarm.node.id=%s", nodeID))
|
||||
containers, err := c.config.Backend.Containers(&apitypes.ContainerListOptions{
|
||||
Filter: filters,
|
||||
Filters: filters,
|
||||
})
|
||||
if err != nil {
|
||||
return []string{}, err
|
||||
@ -840,7 +840,7 @@ func (c *Cluster) GetServices(options apitypes.ServiceListOptions) ([]types.Serv
|
||||
return nil, c.errNoManager()
|
||||
}
|
||||
|
||||
filters, err := newListServicesFilters(options.Filter)
|
||||
filters, err := newListServicesFilters(options.Filters)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -1019,7 +1019,7 @@ func (c *Cluster) GetNodes(options apitypes.NodeListOptions) ([]types.Node, erro
|
||||
return nil, c.errNoManager()
|
||||
}
|
||||
|
||||
filters, err := newListNodesFilters(options.Filter)
|
||||
filters, err := newListNodesFilters(options.Filters)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -1149,7 +1149,7 @@ func (c *Cluster) GetTasks(options apitypes.TaskListOptions) ([]types.Task, erro
|
||||
return nil
|
||||
}
|
||||
|
||||
filters, err := newListTasksFilters(options.Filter, byName)
|
||||
filters, err := newListTasksFilters(options.Filters, byName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@ -217,7 +217,7 @@ func (daemon *Daemon) reducePsContainer(container *container.Container, ctx *lis
|
||||
|
||||
// foldFilter generates the container filter based on the user's filtering options.
|
||||
func (daemon *Daemon) foldFilter(config *types.ContainerListOptions) (*listContext, error) {
|
||||
psFilters := config.Filter
|
||||
psFilters := config.Filters
|
||||
|
||||
if err := psFilters.Validate(acceptedPsFilterTags); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user