diff --git a/daemon/errors.go b/daemon/errors.go index 6f9eb54039..6ab45f30e3 100644 --- a/daemon/errors.go +++ b/daemon/errors.go @@ -115,7 +115,7 @@ type invalidFilter struct { } func (e invalidFilter) Error() string { - msg := "Invalid filter '" + e.filter + msg := "invalid filter '" + e.filter if e.value != nil { msg += fmt.Sprintf("=%s", e.value) } diff --git a/daemon/images/image_search_test.go b/daemon/images/image_search_test.go index de9fcc194c..c53f8c7f1b 100644 --- a/daemon/images/image_search_test.go +++ b/daemon/images/image_search_test.go @@ -46,31 +46,31 @@ func TestSearchRegistryForImagesErrors(t *testing.T) { }, { filtersArgs: `{"type":{"custom":true}}`, - expectedError: "Invalid filter 'type'", + expectedError: "invalid filter 'type'", }, { filtersArgs: `{"is-automated":{"invalid":true}}`, - expectedError: "Invalid filter 'is-automated=[invalid]'", + expectedError: "invalid filter 'is-automated=[invalid]'", }, { filtersArgs: `{"is-automated":{"true":true,"false":true}}`, - expectedError: "Invalid filter 'is-automated", + expectedError: "invalid filter 'is-automated", }, { filtersArgs: `{"is-official":{"invalid":true}}`, - expectedError: "Invalid filter 'is-official=[invalid]'", + expectedError: "invalid filter 'is-official=[invalid]'", }, { filtersArgs: `{"is-official":{"true":true,"false":true}}`, - expectedError: "Invalid filter 'is-official", + expectedError: "invalid filter 'is-official", }, { filtersArgs: `{"stars":{"invalid":true}}`, - expectedError: "Invalid filter 'stars=invalid'", + expectedError: "invalid filter 'stars=invalid'", }, { filtersArgs: `{"stars":{"1":true,"invalid":true}}`, - expectedError: "Invalid filter 'stars=invalid'", + expectedError: "invalid filter 'stars=invalid'", }, } for index, e := range errorCases { diff --git a/daemon/images/locals.go b/daemon/images/locals.go index a57ea2da60..d62c345b72 100644 --- a/daemon/images/locals.go +++ b/daemon/images/locals.go @@ -12,7 +12,7 @@ type invalidFilter struct { } func (e invalidFilter) Error() string { - msg := "Invalid filter '" + e.filter + msg := "invalid filter '" + e.filter if e.value != nil { msg += fmt.Sprintf("=%s", e.value) } diff --git a/daemon/list_test.go b/daemon/list_test.go index 1db783ff52..955d137aa1 100644 --- a/daemon/list_test.go +++ b/daemon/list_test.go @@ -91,7 +91,7 @@ func TestListInvalidFilter(t *testing.T) { _, err = d.Containers(&types.ContainerListOptions{ Filters: f, }) - assert.Assert(t, is.Error(err, "Invalid filter 'invalid'")) + assert.Assert(t, is.Error(err, "invalid filter 'invalid'")) } func TestNameFilter(t *testing.T) { diff --git a/integration-cli/docker_cli_images_test.go b/integration-cli/docker_cli_images_test.go index 193cb20ab0..dbb9f893a9 100644 --- a/integration-cli/docker_cli_images_test.go +++ b/integration-cli/docker_cli_images_test.go @@ -68,7 +68,7 @@ func (s *DockerSuite) TestImagesOrderedByCreationDate(c *testing.T) { func (s *DockerSuite) TestImagesErrorWithInvalidFilterNameTest(c *testing.T) { out, _, err := dockerCmdWithError("images", "-f", "FOO=123") assert.ErrorContains(c, err, "") - assert.Assert(c, strings.Contains(out, "Invalid filter")) + assert.Assert(c, strings.Contains(out, "invalid filter")) } func (s *DockerSuite) TestImagesFilterLabelMatch(c *testing.T) { @@ -252,7 +252,7 @@ func (s *DockerSuite) TestImagesEnsureDanglingImageOnlyListedOnce(c *testing.T) func (s *DockerSuite) TestImagesWithIncorrectFilter(c *testing.T) { out, _, err := dockerCmdWithError("images", "-f", "dangling=invalid") assert.ErrorContains(c, err, "") - assert.Assert(c, strings.Contains(out, "Invalid filter")) + assert.Assert(c, strings.Contains(out, "invalid filter")) } func (s *DockerSuite) TestImagesEnsureOnlyHeadsImagesShown(c *testing.T) { diff --git a/integration-cli/docker_cli_ps_test.go b/integration-cli/docker_cli_ps_test.go index fe625263bc..ad0fbfb1c4 100644 --- a/integration-cli/docker_cli_ps_test.go +++ b/integration-cli/docker_cli_ps_test.go @@ -203,7 +203,7 @@ func (s *DockerSuite) TestPsListContainersFilterStatus(c *testing.T) { assert.Equal(c, RemoveOutputForExistingElements(containerOut, existingContainers), secondID) result := cli.Docker(cli.Args("ps", "-a", "-q", "--filter=status=rubbish"), cli.WithTimeout(time.Second*60)) - err := "Invalid filter 'status=rubbish'" + err := "invalid filter 'status=rubbish'" if versions.LessThan(testEnv.DaemonAPIVersion(), "1.32") { err = "Unrecognised filter value for status: rubbish" } diff --git a/integration-cli/docker_cli_search_test.go b/integration-cli/docker_cli_search_test.go index bf858235cb..a61c5e7cdc 100644 --- a/integration-cli/docker_cli_search_test.go +++ b/integration-cli/docker_cli_search_test.go @@ -17,19 +17,19 @@ func (s *DockerSuite) TestSearchOnCentralRegistry(c *testing.T) { func (s *DockerSuite) TestSearchStarsOptionWithWrongParameter(c *testing.T) { out, _, err := dockerCmdWithError("search", "--filter", "stars=a", "busybox") assert.ErrorContains(c, err, "", out) - assert.Assert(c, strings.Contains(out, "Invalid filter"), "couldn't find the invalid filter warning") + assert.Assert(c, strings.Contains(out, "invalid filter"), "couldn't find the invalid filter warning") out, _, err = dockerCmdWithError("search", "-f", "stars=a", "busybox") assert.ErrorContains(c, err, "", out) - assert.Assert(c, strings.Contains(out, "Invalid filter"), "couldn't find the invalid filter warning") + assert.Assert(c, strings.Contains(out, "invalid filter"), "couldn't find the invalid filter warning") out, _, err = dockerCmdWithError("search", "-f", "is-automated=a", "busybox") assert.ErrorContains(c, err, "", out) - assert.Assert(c, strings.Contains(out, "Invalid filter"), "couldn't find the invalid filter warning") + assert.Assert(c, strings.Contains(out, "invalid filter"), "couldn't find the invalid filter warning") out, _, err = dockerCmdWithError("search", "-f", "is-official=a", "busybox") assert.ErrorContains(c, err, "", out) - assert.Assert(c, strings.Contains(out, "Invalid filter"), "couldn't find the invalid filter warning") + assert.Assert(c, strings.Contains(out, "invalid filter"), "couldn't find the invalid filter warning") } func (s *DockerSuite) TestSearchCmdOptions(c *testing.T) { diff --git a/integration-cli/docker_cli_volume_test.go b/integration-cli/docker_cli_volume_test.go index b7424c82af..2dae8ff43b 100644 --- a/integration-cli/docker_cli_volume_test.go +++ b/integration-cli/docker_cli_volume_test.go @@ -166,13 +166,13 @@ func (s *DockerSuite) TestVolumeCLILsFilterDangling(c *testing.T) { func (s *DockerSuite) TestVolumeCLILsErrorWithInvalidFilterName(c *testing.T) { out, _, err := dockerCmdWithError("volume", "ls", "-f", "FOO=123") assert.ErrorContains(c, err, "") - assert.Assert(c, strings.Contains(out, "Invalid filter")) + assert.Assert(c, strings.Contains(out, "invalid filter")) } func (s *DockerSuite) TestVolumeCLILsWithIncorrectFilterValue(c *testing.T) { out, _, err := dockerCmdWithError("volume", "ls", "-f", "dangling=invalid") assert.ErrorContains(c, err, "") - assert.Assert(c, strings.Contains(out, "Invalid filter")) + assert.Assert(c, strings.Contains(out, "invalid filter")) } func (s *DockerSuite) TestVolumeCLIRm(c *testing.T) { diff --git a/plugin/errors.go b/plugin/errors.go index 44d99b39b2..4aca5ff71d 100644 --- a/plugin/errors.go +++ b/plugin/errors.go @@ -32,7 +32,7 @@ type invalidFilter struct { } func (e invalidFilter) Error() string { - msg := "Invalid filter '" + e.filter + msg := "invalid filter '" + e.filter if len(e.value) > 0 { msg += fmt.Sprintf("=%s", e.value) } diff --git a/volume/service/errors.go b/volume/service/errors.go index ce2d678dab..c735fca6cd 100644 --- a/volume/service/errors.go +++ b/volume/service/errors.go @@ -101,7 +101,7 @@ type invalidFilter struct { } func (e invalidFilter) Error() string { - msg := "Invalid filter '" + e.filter + msg := "invalid filter '" + e.filter if e.value != nil { msg += fmt.Sprintf("=%s", e.value) }