Probe all drivers if volume driver not specified
This fixes an issue where `docker run -v foo:/bar --volume-driver <remote driver>` -> daemon restart -> `docker run -v foo:/bar` would make a `local` volume after the restart instead of using the existing volume from the remote driver. Signed-off-by: Brian Goff <cpuguy83@gmail.com> Upstream-commit: 00ec6102d993a752bd8dfb4ee393a4e58e59a4fe Component: engine
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/pkg/integration/checker"
|
||||
"github.com/docker/engine-api/types"
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
@@ -410,3 +411,15 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverGet(c *check.C) {
|
||||
c.Assert(s.ec.gets, check.Equals, 1)
|
||||
c.Assert(out, checker.Contains, "No such volume")
|
||||
}
|
||||
|
||||
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverWithDaemnRestart(c *check.C) {
|
||||
dockerCmd(c, "volume", "create", "-d", "test-external-volume-driver", "--name", "abc")
|
||||
err := s.d.Restart()
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
dockerCmd(c, "run", "--name=test", "-v", "abc:/foo", "busybox", "true")
|
||||
var mounts []types.MountPoint
|
||||
inspectFieldAndMarshall(c, "test", "Mounts", &mounts)
|
||||
c.Assert(mounts, checker.HasLen, 1)
|
||||
c.Assert(mounts[0].Driver, checker.Equals, "test-external-volume-driver")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user