Skip to content

Commit

Permalink
Merge pull request moby#32268 from cpuguy83/volume_err_obfuscate
Browse files Browse the repository at this point in the history
don't obfuscate error during volume create
  • Loading branch information
cpuguy83 authored Apr 5, 2017
2 parents 8d96619 + 3b80094 commit b7c3b31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions daemon/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit b7c3b31

Please sign in to comment.