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:
Zhang Wei
2016-11-01 22:01:16 +08:00
parent d375460d63
commit 9cb45952e0
23 changed files with 55 additions and 55 deletions

View File

@ -79,10 +79,10 @@ func (p *preProcessor) Networks() bool {
func buildContainerListOptions(opts *psOptions) (*types.ContainerListOptions, error) {
options := &types.ContainerListOptions{
All: opts.all,
Limit: opts.last,
Size: opts.size,
Filter: opts.filter.Value(),
All: opts.all,
Limit: opts.last,
Size: opts.size,
Filters: opts.filter.Value(),
}
if opts.nLatest && opts.last == -1 {

View File

@ -55,10 +55,10 @@ func TestBuildContainerListOptions(t *testing.T) {
assert.Equal(t, c.expectedAll, options.All)
assert.Equal(t, c.expectedSize, options.Size)
assert.Equal(t, c.expectedLimit, options.Limit)
assert.Equal(t, options.Filter.Len(), len(c.expectedFilters))
assert.Equal(t, options.Filters.Len(), len(c.expectedFilters))
for k, v := range c.expectedFilters {
f := options.Filter
f := options.Filters
if !f.ExactMatch(k, v) {
t.Fatalf("Expected filter with key %s to be %s but got %s", k, v, f.Get(k))
}