mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client: add Filters type
Add a new type to use for building filter predicates for API requests, replacing "./api/types/filters".Args in the client. Remove the now unused api/types/filters package. Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
@@ -11,7 +11,6 @@ import (
|
||||
"testing"
|
||||
|
||||
cerrdefs "github.com/containerd/errdefs"
|
||||
"github.com/moby/moby/api/types/filters"
|
||||
"github.com/moby/moby/api/types/registry"
|
||||
"gotest.tools/v3/assert"
|
||||
is "gotest.tools/v3/assert/cmp"
|
||||
@@ -133,10 +132,7 @@ func TestImageSearchWithoutErrors(t *testing.T) {
|
||||
}))
|
||||
assert.NilError(t, err)
|
||||
results, err := client.ImageSearch(context.Background(), "some-image", ImageSearchOptions{
|
||||
Filters: filters.NewArgs(
|
||||
filters.Arg("is-automated", "true"),
|
||||
filters.Arg("stars", "3"),
|
||||
),
|
||||
Filters: make(Filters).Add("is-automated", "true").Add("stars", "3"),
|
||||
})
|
||||
assert.NilError(t, err)
|
||||
assert.Check(t, is.Len(results, 1))
|
||||
|
||||
Reference in New Issue
Block a user