Explorar el Código

daemon/create.go: Fix error capitalization

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
Albin Kerouanton hace 2 años
padre
commit
38e26c4717

+ 2 - 2
daemon/create.go

@@ -305,7 +305,7 @@ func (daemon *Daemon) mergeAndVerifyConfig(config *containertypes.Config, img *i
 		config.Entrypoint = nil
 	}
 	if len(config.Entrypoint) == 0 && len(config.Cmd) == 0 {
-		return fmt.Errorf("No command specified")
+		return fmt.Errorf("no command specified")
 	}
 	return nil
 }
@@ -321,7 +321,7 @@ func verifyNetworkingConfig(nwConfig *networktypes.NetworkingConfig) error {
 		for k := range nwConfig.EndpointsConfig {
 			l = append(l, k)
 		}
-		return fmt.Errorf("Container cannot be connected to network endpoints: %s", strings.Join(l, ", "))
+		return fmt.Errorf("container cannot be connected to network endpoints: %s", strings.Join(l, ", "))
 	}
 
 	for k, v := range nwConfig.EndpointsConfig {

+ 2 - 3
integration-cli/docker_api_containers_test.go

@@ -550,8 +550,7 @@ func (s *DockerAPISuite) TestContainerAPICreateEmptyConfig(c *testing.T) {
 
 	_, err = apiClient.ContainerCreate(context.Background(), &container.Config{}, &container.HostConfig{}, &network.NetworkingConfig{}, nil, "")
 
-	expected := "No command specified"
-	assert.ErrorContains(c, err, expected)
+	assert.ErrorContains(c, err, "no command specified")
 }
 
 func (s *DockerAPISuite) TestContainerAPICreateMultipleNetworksConfig(c *testing.T) {
@@ -575,7 +574,7 @@ func (s *DockerAPISuite) TestContainerAPICreateMultipleNetworksConfig(c *testing
 	_, err = apiClient.ContainerCreate(context.Background(), &config, &container.HostConfig{}, &networkingConfig, nil, "")
 	msg := err.Error()
 	// network name order in error message is not deterministic
-	assert.Assert(c, strings.Contains(msg, "Container cannot be connected to network endpoints"))
+	assert.Assert(c, strings.Contains(msg, "container cannot be connected to network endpoints"))
 	assert.Assert(c, strings.Contains(msg, "net1"))
 	assert.Assert(c, strings.Contains(msg, "net2"))
 	assert.Assert(c, strings.Contains(msg, "net3"))

+ 2 - 2
integration-cli/docker_cli_run_test.go

@@ -1948,7 +1948,7 @@ func (s *DockerCLIRunSuite) TestRunCidFileCleanupIfEmpty(c *testing.T) {
 	out, _, err := dockerCmdWithError("run", "--cidfile", tmpCidFile, image)
 	if err == nil {
 		c.Fatalf("Run without command must fail. out=%s", out)
-	} else if !strings.Contains(out, "No command specified") {
+	} else if !strings.Contains(out, "no command specified") {
 		c.Fatalf("Run without command failed with wrong output. out=%s\nerr=%v", out, err)
 	}
 
@@ -3988,7 +3988,7 @@ exec "$@"`,
 	// CMD will be reset as well (the same as setting a custom entrypoint)
 	cli.Docker(cli.Args("run", "--entrypoint=", "-t", name)).Assert(c, icmd.Expected{
 		ExitCode: 125,
-		Err:      "No command specified",
+		Err:      "no command specified",
 	})
 }