mirror of
https://github.com/moby/moby.git
synced 2026-08-04 15:11:00 +00:00
volume/local: remove hack for downgrading docker 1.7 to 1.6
This was added inbd9814f0dbto support downgrading docker 1.7 to 1.6. The related migration code was removed in0023abbad3(Docker 18.05), which was also the last consumer of VolumeDataPathName outside of the package, so that const can be un-exported. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -21,11 +21,11 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// VolumeDataPathName is the name of the directory where the volume data is stored.
|
||||
// It uses a very distinctive name to avoid collisions migrating data between
|
||||
// Docker versions.
|
||||
const (
|
||||
VolumeDataPathName = "_data"
|
||||
// volumeDataPathName is the name of the directory where the volume data is stored.
|
||||
// It uses a very distinctive name to avoid collisions migrating data between
|
||||
// Docker versions.
|
||||
volumeDataPathName = "_data"
|
||||
volumesPathName = "volumes"
|
||||
)
|
||||
|
||||
@@ -127,7 +127,7 @@ func (r *Root) List() ([]volume.Volume, error) {
|
||||
|
||||
// DataPath returns the constructed path of this volume.
|
||||
func (r *Root) DataPath(volumeName string) string {
|
||||
return filepath.Join(r.path, volumeName, VolumeDataPathName)
|
||||
return filepath.Join(r.path, volumeName, volumeDataPathName)
|
||||
}
|
||||
|
||||
// Name returns the name of Root, defined in the volume package in the DefaultDriverName constant.
|
||||
|
||||
@@ -24,8 +24,6 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
oldVfsDir = filepath.Join("vfs", "dir")
|
||||
|
||||
validOpts = map[string]struct{}{
|
||||
"type": {}, // specify the filesystem type for mount, e.g. nfs
|
||||
"o": {}, // generic mount options
|
||||
@@ -53,16 +51,9 @@ func (o *optsConfig) String() string {
|
||||
// scopedPath verifies that the path where the volume is located
|
||||
// is under Docker's root and the valid local paths.
|
||||
func (r *Root) scopedPath(realPath string) bool {
|
||||
// Volumes path for Docker version >= 1.7
|
||||
if strings.HasPrefix(realPath, filepath.Join(r.scope, volumesPathName)) && realPath != filepath.Join(r.scope, volumesPathName) {
|
||||
return true
|
||||
}
|
||||
|
||||
// Volumes path for Docker version < 1.7
|
||||
if strings.HasPrefix(realPath, filepath.Join(r.scope, oldVfsDir)) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user