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:
Cory Snider
2025-10-06 15:18:41 -04:00
parent 778e5bfad3
commit 7ea066c8d1
106 changed files with 380 additions and 853 deletions

View File

@@ -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 {

View File

@@ -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)