From 3da980e8019e615357509231fe542fe22f4a7f65 Mon Sep 17 00:00:00 2001 From: Anusha Ragunathan Date: Mon, 19 Sep 2016 13:57:55 -0700 Subject: [PATCH] Add missing call to "VolumeDriver.Mount" during container start. On container start, volume mounts are setup which should include invoking "VolumeDriver.Mount" to setup necessary mounts. This was missing for Windows containers. Fix that. Signed-off-by: Anusha Ragunathan Upstream-commit: b15264004d08ea86a12b675b1d6206cbbc90e44c Component: engine --- components/engine/daemon/volumes_windows.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/components/engine/daemon/volumes_windows.go b/components/engine/daemon/volumes_windows.go index b008dfb511..98698ee752 100644 --- a/components/engine/daemon/volumes_windows.go +++ b/components/engine/daemon/volumes_windows.go @@ -3,7 +3,6 @@ package daemon import ( - "fmt" "sort" "github.com/docker/docker/container" @@ -25,14 +24,11 @@ func (daemon *Daemon) setupMounts(c *container.Container) ([]container.Mount, er if err := daemon.lazyInitializeVolume(c.ID, mount); err != nil { return nil, err } - // If there is no source, take it from the volume path - s := mount.Source - if s == "" && mount.Volume != nil { - s = mount.Volume.Path() - } - if s == "" { - return nil, fmt.Errorf("No source for mount name '%s' driver %q destination '%s'", mount.Name, mount.Driver, mount.Destination) + s, err := mount.Setup(c.MountLabel, 0, 0) + if err != nil { + return nil, err } + mnts = append(mnts, container.Mount{ Source: s, Destination: mount.Destination,