diff --git a/integration-cli/daemon/daemon_swarm.go b/integration-cli/daemon/daemon_swarm.go index 74b5877c8d..40e6bada2a 100644 --- a/integration-cli/daemon/daemon_swarm.go +++ b/integration-cli/daemon/daemon_swarm.go @@ -102,14 +102,9 @@ func (d *Daemon) CheckRunningTaskNetworks(c *testing.T) (interface{}, string) { cli := d.NewClientT(c) defer cli.Close() - filterArgs := filters.NewArgs() - filterArgs.Add("desired-state", "running") - - options := types.TaskListOptions{ - Filters: filterArgs, - } - - tasks, err := cli.TaskList(context.Background(), options) + tasks, err := cli.TaskList(context.Background(), types.TaskListOptions{ + Filters: filters.NewArgs(filters.Arg("desired-state", "running")), + }) assert.NilError(c, err) result := make(map[string]int) @@ -126,14 +121,9 @@ func (d *Daemon) CheckRunningTaskImages(c *testing.T) (interface{}, string) { cli := d.NewClientT(c) defer cli.Close() - filterArgs := filters.NewArgs() - filterArgs.Add("desired-state", "running") - - options := types.TaskListOptions{ - Filters: filterArgs, - } - - tasks, err := cli.TaskList(context.Background(), options) + tasks, err := cli.TaskList(context.Background(), types.TaskListOptions{ + Filters: filters.NewArgs(filters.Arg("desired-state", "running")), + }) assert.NilError(c, err) result := make(map[string]int) diff --git a/integration-cli/docker_api_images_test.go b/integration-cli/docker_api_images_test.go index fd3e33b946..6101299416 100644 --- a/integration-cli/docker_api_images_test.go +++ b/integration-cli/docker_api_images_test.go @@ -28,11 +28,9 @@ func (s *DockerAPISuite) TestAPIImagesFilter(c *testing.T) { dockerCmd(c, "tag", "busybox", n) } getImages := func(filter string) []types.ImageSummary { - fltrs := filters.NewArgs() - fltrs.Add("reference", filter) options := types.ImageListOptions{ All: false, - Filters: fltrs, + Filters: filters.NewArgs(filters.Arg("reference", filter)), } images, err := apiClient.ImageList(context.Background(), options) assert.NilError(c, err) diff --git a/integration-cli/docker_api_network_test.go b/integration-cli/docker_api_network_test.go index 383837c470..12a492a5a5 100644 --- a/integration-cli/docker_api_network_test.go +++ b/integration-cli/docker_api_network_test.go @@ -286,13 +286,9 @@ func isNetworkAvailable(c *testing.T, name string) bool { } func getNetworkIDByName(c *testing.T, name string) string { - var ( - v = url.Values{} - filterArgs = filters.NewArgs() - ) - filterArgs.Add("name", name) - filterJSON, err := filters.ToJSON(filterArgs) + filterJSON, err := filters.ToJSON(filters.NewArgs(filters.Arg("name", name))) assert.NilError(c, err) + v := url.Values{} v.Set("filters", filterJSON) resp, body, err := request.Get("/networks?" + v.Encode())