diff --git a/builder/builder.go b/builder/builder.go index f01563812f..86fcd4de91 100644 --- a/builder/builder.go +++ b/builder/builder.go @@ -14,7 +14,6 @@ import ( containerpkg "github.com/docker/docker/container" "github.com/docker/docker/image" "github.com/docker/docker/layer" - "github.com/docker/docker/pkg/containerfs" ) const ( @@ -26,7 +25,7 @@ const ( // instructions in the builder. type Source interface { // Root returns root path for accessing source - Root() containerfs.ContainerFS + Root() string // Close allows to signal that the filesystem tree won't be used anymore. // For Context implementations using a temporary directory, it is recommended to // delete the temporary directory in Close(). @@ -110,6 +109,6 @@ type ROLayer interface { // RWLayer is active layer that can be read/modified type RWLayer interface { Release() error - Root() containerfs.ContainerFS + Root() string Commit() (ROLayer, error) } diff --git a/builder/dockerfile/copy.go b/builder/dockerfile/copy.go index eb458a477d..10a766d3ca 100644 --- a/builder/dockerfile/copy.go +++ b/builder/dockerfile/copy.go @@ -38,7 +38,7 @@ type pathCache interface { // copyInfo is a data object which stores the metadata about each source file in // a copyInstruction type copyInfo struct { - root containerfs.ContainerFS + root string path string hash string noDecompress bool diff --git a/builder/dockerfile/internals_test.go b/builder/dockerfile/internals_test.go index 404dc84bf8..9668590157 100644 --- a/builder/dockerfile/internals_test.go +++ b/builder/dockerfile/internals_test.go @@ -14,7 +14,6 @@ import ( "github.com/docker/docker/image" "github.com/docker/docker/layer" "github.com/docker/docker/pkg/archive" - "github.com/docker/docker/pkg/containerfs" "github.com/docker/go-connections/nat" "github.com/opencontainers/go-digest" "gotest.tools/v3/assert" @@ -183,8 +182,8 @@ func TestDeepCopyRunConfig(t *testing.T) { type MockRWLayer struct{} -func (l *MockRWLayer) Release() error { return nil } -func (l *MockRWLayer) Root() containerfs.ContainerFS { return "" } +func (l *MockRWLayer) Release() error { return nil } +func (l *MockRWLayer) Root() string { return "" } func (l *MockRWLayer) Commit() (builder.ROLayer, error) { return &MockROLayer{ diffID: layer.DiffID(digest.Digest("sha256:1234")), diff --git a/builder/dockerfile/mockbackend_test.go b/builder/dockerfile/mockbackend_test.go index eec26f03e1..ad5b3b120d 100644 --- a/builder/dockerfile/mockbackend_test.go +++ b/builder/dockerfile/mockbackend_test.go @@ -13,7 +13,6 @@ import ( containerpkg "github.com/docker/docker/container" "github.com/docker/docker/image" "github.com/docker/docker/layer" - "github.com/docker/docker/pkg/containerfs" ) // MockBackend implements the builder.Backend interface for unit testing @@ -143,6 +142,6 @@ func (l *mockRWLayer) Commit() (builder.ROLayer, error) { return nil, nil } -func (l *mockRWLayer) Root() containerfs.ContainerFS { +func (l *mockRWLayer) Root() string { return "" } diff --git a/builder/remotecontext/archive.go b/builder/remotecontext/archive.go index 4f1fbf2d6a..9d89329040 100644 --- a/builder/remotecontext/archive.go +++ b/builder/remotecontext/archive.go @@ -15,7 +15,7 @@ import ( ) type archiveContext struct { - root containerfs.ContainerFS + root string sums tarsum.FileInfoSums } @@ -82,7 +82,7 @@ func FromArchive(tarStream io.Reader) (builder.Source, error) { return tsc, nil } -func (c *archiveContext) Root() containerfs.ContainerFS { +func (c *archiveContext) Root() string { return c.root } @@ -115,7 +115,7 @@ func (c *archiveContext) Hash(path string) (string, error) { return path, nil // backwards compat TODO: see if really needed } -func normalize(path string, root containerfs.ContainerFS) (cleanPath, fullPath string, err error) { +func normalize(path string, root string) (cleanPath, fullPath string, err error) { cleanPath = filepath.Clean(string(filepath.Separator) + path)[1:] fullPath, err = containerfs.ResolveScopedPath(root, path) if err != nil { diff --git a/builder/remotecontext/detect_test.go b/builder/remotecontext/detect_test.go index 8d514235b3..aa73e565c7 100644 --- a/builder/remotecontext/detect_test.go +++ b/builder/remotecontext/detect_test.go @@ -9,7 +9,6 @@ import ( "testing" "github.com/docker/docker/builder" - "github.com/docker/docker/pkg/containerfs" ) const ( @@ -105,14 +104,14 @@ func TestProcessShouldLeaveAllFiles(t *testing.T) { // TODO: remove after moving to a separate pkg type stubRemote struct { - root containerfs.ContainerFS + root string } func (r *stubRemote) Hash(path string) (string, error) { return "", errors.New("not implemented") } -func (r *stubRemote) Root() containerfs.ContainerFS { +func (r *stubRemote) Root() string { return r.root } func (r *stubRemote) Close() error { diff --git a/builder/remotecontext/lazycontext.go b/builder/remotecontext/lazycontext.go index 620671d444..d7234d6656 100644 --- a/builder/remotecontext/lazycontext.go +++ b/builder/remotecontext/lazycontext.go @@ -8,7 +8,6 @@ import ( "strings" "github.com/docker/docker/builder" - "github.com/docker/docker/pkg/containerfs" "github.com/docker/docker/pkg/pools" "github.com/pkg/errors" ) @@ -16,7 +15,7 @@ import ( // NewLazySource creates a new LazyContext. LazyContext defines a hashed build // context based on a root directory. Individual files are hashed first time // they are asked. It is not safe to call methods of LazyContext concurrently. -func NewLazySource(root containerfs.ContainerFS) (builder.Source, error) { +func NewLazySource(root string) (builder.Source, error) { return &lazySource{ root: root, sums: make(map[string]string), @@ -24,11 +23,11 @@ func NewLazySource(root containerfs.ContainerFS) (builder.Source, error) { } type lazySource struct { - root containerfs.ContainerFS + root string sums map[string]string } -func (c *lazySource) Root() containerfs.ContainerFS { +func (c *lazySource) Root() string { return c.root } @@ -88,7 +87,7 @@ func (c *lazySource) prepareHash(relPath string, fi os.FileInfo) (string, error) // Rel makes a path relative to base path. Same as `filepath.Rel` but can also // handle UUID paths in windows. -func Rel(basepath containerfs.ContainerFS, targpath string) (string, error) { +func Rel(basepath string, targpath string) (string, error) { // filepath.Rel can't handle UUID paths in windows if runtime.GOOS == "windows" { pfx := basepath + `\` diff --git a/builder/remotecontext/tarsum.go b/builder/remotecontext/tarsum.go index 6ef24f9b9e..e6486e9736 100644 --- a/builder/remotecontext/tarsum.go +++ b/builder/remotecontext/tarsum.go @@ -5,7 +5,6 @@ import ( "path/filepath" "sync" - "github.com/docker/docker/pkg/containerfs" iradix "github.com/hashicorp/go-immutable-radix" "github.com/opencontainers/go-digest" "github.com/pkg/errors" @@ -19,7 +18,7 @@ type hashed interface { // CachableSource is a source that contains cache records for its contents type CachableSource struct { mu sync.Mutex - root containerfs.ContainerFS + root string tree *iradix.Tree txn *iradix.Txn } @@ -145,7 +144,7 @@ func (cs *CachableSource) Hash(path string) (string, error) { } // Root returns a root directory for the source -func (cs *CachableSource) Root() containerfs.ContainerFS { +func (cs *CachableSource) Root() string { return cs.root } diff --git a/container/container.go b/container/container.go index 9c15d1f384..d09a130968 100644 --- a/container/container.go +++ b/container/container.go @@ -61,10 +61,10 @@ type ExitStatus struct { type Container struct { StreamConfig *stream.Config // embed for Container to support states directly. - *State `json:"State"` // Needed for Engine API version <= 1.11 - Root string `json:"-"` // Path to the "home" of the container, including metadata. - BaseFS containerfs.ContainerFS `json:"-"` // interface containing graphdriver mount - RWLayer layer.RWLayer `json:"-"` + *State `json:"State"` // Needed for Engine API version <= 1.11 + Root string `json:"-"` // Path to the "home" of the container, including metadata. + BaseFS string `json:"-"` // Path to the graphdriver mountpoint + RWLayer layer.RWLayer `json:"-"` ID string Created time.Time Managed bool diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index acc2e85ba6..3becb30199 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -38,7 +38,6 @@ import ( "github.com/docker/docker/libnetwork/options" lntypes "github.com/docker/docker/libnetwork/types" "github.com/docker/docker/opts" - "github.com/docker/docker/pkg/containerfs" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/parsers" "github.com/docker/docker/pkg/parsers/kernel" @@ -1072,8 +1071,8 @@ func removeDefaultBridgeInterface() { } } -func setupInitLayer(idMapping idtools.IdentityMapping) func(containerfs.ContainerFS) error { - return func(initPath containerfs.ContainerFS) error { +func setupInitLayer(idMapping idtools.IdentityMapping) func(string) error { + return func(initPath string) error { return initlayer.Setup(initPath, idMapping.RootPair()) } } diff --git a/daemon/daemon_windows.go b/daemon/daemon_windows.go index 12f014c890..c64e4570ba 100644 --- a/daemon/daemon_windows.go +++ b/daemon/daemon_windows.go @@ -23,7 +23,6 @@ import ( winlibnetwork "github.com/docker/docker/libnetwork/drivers/windows" "github.com/docker/docker/libnetwork/netlabel" "github.com/docker/docker/libnetwork/options" - "github.com/docker/docker/pkg/containerfs" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/parsers" "github.com/docker/docker/pkg/parsers/operatingsystem" @@ -64,7 +63,7 @@ func (daemon *Daemon) parseSecurityOpt(container *container.Container, hostConfi return nil } -func setupInitLayer(idMapping idtools.IdentityMapping) func(containerfs.ContainerFS) error { +func setupInitLayer(idMapping idtools.IdentityMapping) func(string) error { return nil } diff --git a/daemon/graphdriver/aufs/aufs.go b/daemon/graphdriver/aufs/aufs.go index 8066549a62..6e33590698 100644 --- a/daemon/graphdriver/aufs/aufs.go +++ b/daemon/graphdriver/aufs/aufs.go @@ -351,7 +351,7 @@ func atomicRemove(source string) error { // Get returns the rootfs path for the id. // This will mount the dir at its given path -func (a *Driver) Get(id, mountLabel string) (containerfs.ContainerFS, error) { +func (a *Driver) Get(id, mountLabel string) (string, error) { a.locker.Lock(id) defer a.locker.Unlock(id) parents, err := a.getParentLayerPaths(id) diff --git a/daemon/graphdriver/btrfs/btrfs.go b/daemon/graphdriver/btrfs/btrfs.go index 8373d921a5..ac920c88a2 100644 --- a/daemon/graphdriver/btrfs/btrfs.go +++ b/daemon/graphdriver/btrfs/btrfs.go @@ -627,7 +627,7 @@ func (d *Driver) Remove(id string) error { } // Get the requested filesystem id. -func (d *Driver) Get(id, mountLabel string) (containerfs.ContainerFS, error) { +func (d *Driver) Get(id, mountLabel string) (string, error) { dir := d.subvolumesDirID(id) st, err := os.Stat(dir) if err != nil { diff --git a/daemon/graphdriver/devmapper/driver.go b/daemon/graphdriver/devmapper/driver.go index 894345e468..15465e439d 100644 --- a/daemon/graphdriver/devmapper/driver.go +++ b/daemon/graphdriver/devmapper/driver.go @@ -10,7 +10,6 @@ import ( "strconv" "github.com/docker/docker/daemon/graphdriver" - "github.com/docker/docker/pkg/containerfs" "github.com/docker/docker/pkg/devicemapper" "github.com/docker/docker/pkg/idtools" units "github.com/docker/go-units" @@ -175,7 +174,7 @@ func (d *Driver) Remove(id string) error { } // Get mounts a device with given id into the root filesystem -func (d *Driver) Get(id, mountLabel string) (containerfs.ContainerFS, error) { +func (d *Driver) Get(id, mountLabel string) (string, error) { d.locker.Lock(id) defer d.locker.Unlock(id) mp := path.Join(d.home, "mnt", id) diff --git a/daemon/graphdriver/driver.go b/daemon/graphdriver/driver.go index 06f088fa73..34a2ec4fe7 100644 --- a/daemon/graphdriver/driver.go +++ b/daemon/graphdriver/driver.go @@ -7,7 +7,6 @@ import ( "strings" "github.com/docker/docker/pkg/archive" - "github.com/docker/docker/pkg/containerfs" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/plugingetter" "github.com/pkg/errors" @@ -60,7 +59,7 @@ type ProtoDriver interface { // Get returns the mountpoint for the layered filesystem referred // to by this id. You can optionally specify a mountLabel or "". // Returns the absolute path to the mounted layered filesystem. - Get(id, mountLabel string) (fs containerfs.ContainerFS, err error) + Get(id, mountLabel string) (fs string, err error) // Put releases the system resources for the specified id, // e.g, unmounting layered filesystem. Put(id string) error diff --git a/daemon/graphdriver/fuse-overlayfs/fuseoverlayfs.go b/daemon/graphdriver/fuse-overlayfs/fuseoverlayfs.go index aa7799e1c9..0607b8054b 100644 --- a/daemon/graphdriver/fuse-overlayfs/fuseoverlayfs.go +++ b/daemon/graphdriver/fuse-overlayfs/fuseoverlayfs.go @@ -303,7 +303,7 @@ func (d *Driver) Remove(id string) error { } // Get creates and mounts the required file system for the given id and returns the mount path. -func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, retErr error) { +func (d *Driver) Get(id, mountLabel string) (_ string, retErr error) { d.locker.Lock(id) defer d.locker.Unlock(id) dir := d.dir(id) diff --git a/daemon/graphdriver/overlay/overlay.go b/daemon/graphdriver/overlay/overlay.go index 01d4982e12..8346ff1cd0 100644 --- a/daemon/graphdriver/overlay/overlay.go +++ b/daemon/graphdriver/overlay/overlay.go @@ -339,7 +339,7 @@ func (d *Driver) Remove(id string) error { } // Get creates and mounts the required file system for the given id and returns the mount path. -func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, err error) { +func (d *Driver) Get(id, mountLabel string) (_ string, err error) { d.locker.Lock(id) defer d.locker.Unlock(id) dir := d.dir(id) diff --git a/daemon/graphdriver/overlay2/overlay.go b/daemon/graphdriver/overlay2/overlay.go index 9140ea089f..f373cfb7b8 100644 --- a/daemon/graphdriver/overlay2/overlay.go +++ b/daemon/graphdriver/overlay2/overlay.go @@ -513,7 +513,7 @@ func (d *Driver) Remove(id string) error { } // Get creates and mounts the required file system for the given id and returns the mount path. -func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, retErr error) { +func (d *Driver) Get(id, mountLabel string) (_ string, retErr error) { d.locker.Lock(id) defer d.locker.Unlock(id) dir := d.dir(id) diff --git a/daemon/graphdriver/proxy.go b/daemon/graphdriver/proxy.go index 94185131d0..024c32092e 100644 --- a/daemon/graphdriver/proxy.go +++ b/daemon/graphdriver/proxy.go @@ -6,7 +6,6 @@ import ( "io" "github.com/docker/docker/pkg/archive" - "github.com/docker/docker/pkg/containerfs" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/plugingetter" "github.com/docker/docker/pkg/plugins" @@ -128,7 +127,7 @@ func (d *graphDriverProxy) Remove(id string) error { return nil } -func (d *graphDriverProxy) Get(id, mountLabel string) (containerfs.ContainerFS, error) { +func (d *graphDriverProxy) Get(id, mountLabel string) (string, error) { args := &graphDriverRequest{ ID: id, MountLabel: mountLabel, diff --git a/daemon/graphdriver/vfs/driver.go b/daemon/graphdriver/vfs/driver.go index d99b82e833..f762ed7ec2 100644 --- a/daemon/graphdriver/vfs/driver.go +++ b/daemon/graphdriver/vfs/driver.go @@ -185,7 +185,7 @@ func (d *Driver) Remove(id string) error { } // Get returns the directory for the given id. -func (d *Driver) Get(id, mountLabel string) (containerfs.ContainerFS, error) { +func (d *Driver) Get(id, mountLabel string) (string, error) { dir := d.dir(id) if st, err := os.Stat(dir); err != nil { return "", err diff --git a/daemon/graphdriver/windows/windows.go b/daemon/graphdriver/windows/windows.go index 383c3b7473..75e6035a87 100644 --- a/daemon/graphdriver/windows/windows.go +++ b/daemon/graphdriver/windows/windows.go @@ -27,7 +27,6 @@ import ( "github.com/Microsoft/hcsshim/osversion" "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/pkg/archive" - "github.com/docker/docker/pkg/containerfs" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/pkg/longpath" @@ -393,7 +392,7 @@ func (d *Driver) GetLayerPath(id string) (string, error) { } // Get returns the rootfs path for the id. This will mount the dir at its given path. -func (d *Driver) Get(id, mountLabel string) (containerfs.ContainerFS, error) { +func (d *Driver) Get(id, mountLabel string) (string, error) { logrus.Debugf("WindowsGraphDriver Get() id %s mountLabel %s", id, mountLabel) var dir string diff --git a/daemon/graphdriver/zfs/zfs.go b/daemon/graphdriver/zfs/zfs.go index 82f72bf698..cafb77fd5d 100644 --- a/daemon/graphdriver/zfs/zfs.go +++ b/daemon/graphdriver/zfs/zfs.go @@ -14,7 +14,6 @@ import ( "time" "github.com/docker/docker/daemon/graphdriver" - "github.com/docker/docker/pkg/containerfs" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/parsers" zfs "github.com/mistifyio/go-zfs" @@ -363,7 +362,7 @@ func (d *Driver) Remove(id string) error { } // Get returns the mountpoint for the given id after creating the target directories if necessary. -func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, retErr error) { +func (d *Driver) Get(id, mountLabel string) (_ string, retErr error) { d.locker.Lock(id) defer d.locker.Unlock(id) mountpoint := d.mountPath(id) diff --git a/daemon/images/image_builder.go b/daemon/images/image_builder.go index eee058b9d7..af2d4073cc 100644 --- a/daemon/images/image_builder.go +++ b/daemon/images/image_builder.go @@ -14,7 +14,6 @@ import ( "github.com/docker/docker/errdefs" "github.com/docker/docker/image" "github.com/docker/docker/layer" - "github.com/docker/docker/pkg/containerfs" "github.com/docker/docker/pkg/progress" "github.com/docker/docker/pkg/streamformatter" "github.com/docker/docker/pkg/stringid" @@ -83,10 +82,10 @@ type rwLayer struct { released bool layerStore layer.Store rwLayer layer.RWLayer - fs containerfs.ContainerFS + fs string } -func (l *rwLayer) Root() containerfs.ContainerFS { +func (l *rwLayer) Root() string { return l.fs } diff --git a/daemon/initlayer/setup_unix.go b/daemon/initlayer/setup_unix.go index 132e105d5c..4d2c84cafb 100644 --- a/daemon/initlayer/setup_unix.go +++ b/daemon/initlayer/setup_unix.go @@ -8,7 +8,6 @@ import ( "path/filepath" "strings" - "github.com/docker/docker/pkg/containerfs" "github.com/docker/docker/pkg/idtools" "golang.org/x/sys/unix" ) @@ -18,7 +17,7 @@ import ( // // This extra layer is used by all containers as the top-most ro layer. It protects // the container from unwanted side-effects on the rw layer. -func Setup(initLayerFs containerfs.ContainerFS, rootIdentity idtools.Identity) error { +func Setup(initLayerFs string, rootIdentity idtools.Identity) error { // Since all paths are local to the container, we can just extract initLayerFs.Path() initLayer := initLayerFs diff --git a/layer/layer.go b/layer/layer.go index f5a4792498..330f359632 100644 --- a/layer/layer.go +++ b/layer/layer.go @@ -15,7 +15,6 @@ import ( "github.com/docker/distribution" "github.com/docker/docker/pkg/archive" - "github.com/docker/docker/pkg/containerfs" "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" ) @@ -114,7 +113,7 @@ type RWLayer interface { // Mount mounts the RWLayer and returns the filesystem path // to the writable layer. - Mount(mountLabel string) (containerfs.ContainerFS, error) + Mount(mountLabel string) (string, error) // Unmount unmounts the RWLayer. This should be called // for every mount. If there are multiple mount calls @@ -158,7 +157,7 @@ type Metadata struct { // writable mount. Changes made here will // not be included in the Tar stream of the // RWLayer. -type MountInit func(root containerfs.ContainerFS) error +type MountInit func(root string) error // CreateRWLayerOpts contains optional arguments to be passed to CreateRWLayer type CreateRWLayerOpts struct { diff --git a/layer/layer_test.go b/layer/layer_test.go index fe9b36a0dc..afda53a871 100644 --- a/layer/layer_test.go +++ b/layer/layer_test.go @@ -13,7 +13,6 @@ import ( "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/daemon/graphdriver/vfs" "github.com/docker/docker/pkg/archive" - "github.com/docker/docker/pkg/containerfs" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/stringid" "github.com/opencontainers/go-digest" @@ -80,7 +79,7 @@ func newTestStore(t *testing.T) (Store, string, func()) { } } -type layerInit func(root containerfs.ContainerFS) error +type layerInit func(root string) error func createLayer(ls Store, parent ChainID, layerFunc layerInit) (Layer, error) { containerID := stringid.GenerateRandomID() @@ -121,7 +120,7 @@ func createLayer(ls Store, parent ChainID, layerFunc layerInit) (Layer, error) { } type FileApplier interface { - ApplyFile(root containerfs.ContainerFS) error + ApplyFile(root string) error } type testFile struct { @@ -138,7 +137,7 @@ func newTestFile(name string, content []byte, perm os.FileMode) FileApplier { } } -func (tf *testFile) ApplyFile(root containerfs.ContainerFS) error { +func (tf *testFile) ApplyFile(root string) error { fullPath := filepath.Join(root, tf.name) if err := os.MkdirAll(filepath.Dir(fullPath), 0755); err != nil { return err @@ -153,7 +152,7 @@ func (tf *testFile) ApplyFile(root containerfs.ContainerFS) error { } func initWithFiles(files ...FileApplier) layerInit { - return func(root containerfs.ContainerFS) error { + return func(root string) error { for _, f := range files { if err := f.ApplyFile(root); err != nil { return err diff --git a/layer/mount_test.go b/layer/mount_test.go index 1245ee2dfc..643a52c524 100644 --- a/layer/mount_test.go +++ b/layer/mount_test.go @@ -10,7 +10,6 @@ import ( "github.com/containerd/continuity/driver" "github.com/docker/docker/pkg/archive" - "github.com/docker/docker/pkg/containerfs" ) func TestMountInit(t *testing.T) { @@ -30,7 +29,7 @@ func TestMountInit(t *testing.T) { t.Fatal(err) } - mountInit := func(root containerfs.ContainerFS) error { + mountInit := func(root string) error { return initfile.ApplyFile(root) } @@ -90,7 +89,7 @@ func TestMountSize(t *testing.T) { t.Fatal(err) } - mountInit := func(root containerfs.ContainerFS) error { + mountInit := func(root string) error { return newTestFile("file-init", contentInit, 0777).ApplyFile(root) } rwLayerOpts := &CreateRWLayerOpts{ @@ -142,7 +141,7 @@ func TestMountChanges(t *testing.T) { t.Fatal(err) } - mountInit := func(root containerfs.ContainerFS) error { + mountInit := func(root string) error { return initfile.ApplyFile(root) } rwLayerOpts := &CreateRWLayerOpts{ diff --git a/layer/mounted_layer.go b/layer/mounted_layer.go index f614fd571d..05f98f5f3d 100644 --- a/layer/mounted_layer.go +++ b/layer/mounted_layer.go @@ -5,7 +5,6 @@ import ( "sync" "github.com/docker/docker/pkg/archive" - "github.com/docker/docker/pkg/containerfs" ) type mountedLayer struct { @@ -100,7 +99,7 @@ type referencedRWLayer struct { *mountedLayer } -func (rl *referencedRWLayer) Mount(mountLabel string) (containerfs.ContainerFS, error) { +func (rl *referencedRWLayer) Mount(mountLabel string) (string, error) { return rl.layerStore.driver.Get(rl.mountedLayer.mountID, mountLabel) } diff --git a/pkg/containerfs/containerfs.go b/pkg/containerfs/containerfs.go index 1d600d68d7..e65f783a23 100644 --- a/pkg/containerfs/containerfs.go +++ b/pkg/containerfs/containerfs.go @@ -6,9 +6,6 @@ import ( "github.com/moby/sys/symlink" ) -// ContainerFS is that represents a root file system -type ContainerFS = string - // ResolveScopedPath evaluates the given path scoped to the root. // For example, if root=/a, and path=/b/c, then this function would return /a/b/c. func ResolveScopedPath(root, path string) (string, error) {