mirror of
https://github.com/moby/moby.git
synced 2026-08-09 01:21: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:
@@ -5,7 +5,6 @@ import (
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/moby/moby/api/types/filters"
|
||||
networktypes "github.com/moby/moby/api/types/network"
|
||||
"github.com/moby/moby/client"
|
||||
"github.com/moby/moby/v2/integration/internal/network"
|
||||
@@ -166,7 +165,7 @@ func TestInspectNetwork(t *testing.T) {
|
||||
|
||||
leaderID := func() string {
|
||||
ls, err := c1.NodeList(ctx, client.NodeListOptions{
|
||||
Filters: filters.NewArgs(filters.Arg("role", "manager")),
|
||||
Filters: make(client.Filters).Add("role", "manager"),
|
||||
})
|
||||
assert.NilError(t, err)
|
||||
for _, node := range ls {
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/moby/moby/api/types/filters"
|
||||
networktypes "github.com/moby/moby/api/types/network"
|
||||
"github.com/moby/moby/client"
|
||||
"github.com/moby/moby/v2/internal/testutil"
|
||||
@@ -132,7 +131,7 @@ func TestAPINetworkFilter(t *testing.T) {
|
||||
apiClient := testEnv.APIClient()
|
||||
|
||||
networks, err := apiClient.NetworkList(ctx, client.NetworkListOptions{
|
||||
Filters: filters.NewArgs(filters.Arg("name", networkName)),
|
||||
Filters: make(client.Filters).Add("name", networkName),
|
||||
})
|
||||
|
||||
assert.NilError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user