From 3b80094665b82bd095cb98528a0cf6ff34a43a58 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Fri, 31 Mar 2017 10:59:45 -0400 Subject: [PATCH] don't obfuscate error during create Signed-off-by: Brian Goff --- daemon/create.go | 4 ---- .../docker_cli_external_volume_driver_unix_test.go | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/daemon/create.go b/daemon/create.go index e6d6a136bf..55a106c646 100644 --- a/daemon/create.go +++ b/daemon/create.go @@ -20,7 +20,6 @@ import ( "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/runconfig" - volumestore "github.com/docker/docker/volume/store" "github.com/opencontainers/runc/libcontainer/label" ) @@ -242,9 +241,6 @@ func (daemon *Daemon) VolumeCreate(name, driverName string, opts, labels map[str v, err := daemon.volumes.Create(name, driverName, opts, labels) if err != nil { - if volumestore.IsNameConflict(err) { - return nil, fmt.Errorf("A volume named %s already exists. Choose a different volume name.", name) - } return nil, err } diff --git a/integration-cli/docker_cli_external_volume_driver_unix_test.go b/integration-cli/docker_cli_external_volume_driver_unix_test.go index a168f833a9..d6d1999c23 100644 --- a/integration-cli/docker_cli_external_volume_driver_unix_test.go +++ b/integration-cli/docker_cli_external_volume_driver_unix_test.go @@ -287,7 +287,7 @@ func (s *DockerExternalVolumeSuite) TestVolumeCLICreateOptionConflict(c *check.C out, _, err := dockerCmdWithError("volume", "create", "test", "--driver", volumePluginName) c.Assert(err, check.NotNil, check.Commentf("volume create exception name already in use with another driver")) - c.Assert(out, checker.Contains, "A volume named test already exists") + c.Assert(out, checker.Contains, "must be unique") out, _ = dockerCmd(c, "volume", "inspect", "--format={{ .Driver }}", "test") _, _, err = dockerCmdWithError("volume", "create", "test", "--driver", strings.TrimSpace(out)) @@ -570,7 +570,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverOutOfBandDelete(c *c out, err = s.d.Cmd("volume", "create", "-d", "local", "--name", "test") c.Assert(err, checker.NotNil, check.Commentf(out)) - c.Assert(out, checker.Contains, "volume named test already exists") + c.Assert(out, checker.Contains, "must be unique") // simulate out of band volume deletion on plugin level delete(p.vols, "test")