don't obfuscate error during create

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2017-03-31 10:59:45 -04:00
parent 1325f667ee
commit 3b80094665
2 changed files with 2 additions and 6 deletions

View file

@ -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
}

View file

@ -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")