Move mount parsing to separate package.

This moves the platform specific stuff in a separate package and keeps
the `volume` package and the defined interfaces light to import.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff
2018-04-17 16:50:28 -04:00
parent 69a5611dde
commit 6a70fd222b
27 changed files with 237 additions and 223 deletions

View File

@@ -4,7 +4,7 @@ package daemon // import "github.com/docker/docker/daemon"
import (
"github.com/docker/docker/container"
"github.com/docker/docker/volume"
volumemounts "github.com/docker/docker/volume/mounts"
)
// checkIfPathIsInAVolume checks if the path is in a volume. If it is, it
@@ -12,7 +12,7 @@ import (
// cannot be configured with a read-only rootfs.
func checkIfPathIsInAVolume(container *container.Container, absPath string) (bool, error) {
var toVolume bool
parser := volume.NewParser(container.OS)
parser := volumemounts.NewParser(container.OS)
for _, mnt := range container.MountPoints {
if toVolume = parser.HasResource(mnt, absPath); toVolume {
if mnt.RW {