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

@@ -8,7 +8,6 @@ import (
"testing"
cerrdefs "github.com/containerd/errdefs"
"github.com/moby/moby/api/types/filters"
"github.com/moby/moby/api/types/swarm"
"github.com/moby/moby/client"
"gotest.tools/v3/assert"
@@ -105,7 +104,7 @@ func (d *Daemon) CheckRunningTaskNetworks(ctx context.Context) func(t *testing.T
defer cli.Close()
tasks, err := cli.TaskList(ctx, client.TaskListOptions{
Filters: filters.NewArgs(filters.Arg("desired-state", "running")),
Filters: make(client.Filters).Add("desired-state", "running"),
})
assert.NilError(t, err)
@@ -126,7 +125,7 @@ func (d *Daemon) CheckRunningTaskImages(ctx context.Context) func(t *testing.T)
defer cli.Close()
tasks, err := cli.TaskList(ctx, client.TaskListOptions{
Filters: filters.NewArgs(filters.Arg("desired-state", "running")),
Filters: make(client.Filters).Add("desired-state", "running"),
})
assert.NilError(t, err)