Skip to content

Commit 0abd7ba

Browse files
committed
volume/local: remove hack for downgrading docker 1.7 to 1.6
This was added in bd9814f to support downgrading docker 1.7 to 1.6. The related migration code was removed in 0023abb (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 <[email protected]>
1 parent 888c618 commit 0abd7ba

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

volume/local/local.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ import (
2121
"github.com/sirupsen/logrus"
2222
)
2323

24-
// VolumeDataPathName is the name of the directory where the volume data is stored.
25-
// It uses a very distinctive name to avoid collisions migrating data between
26-
// Docker versions.
2724
const (
28-
VolumeDataPathName = "_data"
25+
// volumeDataPathName is the name of the directory where the volume data is stored.
26+
// It uses a very distinctive name to avoid collisions migrating data between
27+
// Docker versions.
28+
volumeDataPathName = "_data"
2929
volumesPathName = "volumes"
3030
)
3131

@@ -127,7 +127,7 @@ func (r *Root) List() ([]volume.Volume, error) {
127127

128128
// DataPath returns the constructed path of this volume.
129129
func (r *Root) DataPath(volumeName string) string {
130-
return filepath.Join(r.path, volumeName, VolumeDataPathName)
130+
return filepath.Join(r.path, volumeName, volumeDataPathName)
131131
}
132132

133133
// Name returns the name of Root, defined in the volume package in the DefaultDriverName constant.

volume/local/local_unix.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ import (
2424
)
2525

2626
var (
27-
oldVfsDir = filepath.Join("vfs", "dir")
28-
2927
validOpts = map[string]struct{}{
3028
"type": {}, // specify the filesystem type for mount, e.g. nfs
3129
"o": {}, // generic mount options
@@ -53,16 +51,9 @@ func (o *optsConfig) String() string {
5351
// scopedPath verifies that the path where the volume is located
5452
// is under Docker's root and the valid local paths.
5553
func (r *Root) scopedPath(realPath string) bool {
56-
// Volumes path for Docker version >= 1.7
5754
if strings.HasPrefix(realPath, filepath.Join(r.scope, volumesPathName)) && realPath != filepath.Join(r.scope, volumesPathName) {
5855
return true
5956
}
60-
61-
// Volumes path for Docker version < 1.7
62-
if strings.HasPrefix(realPath, filepath.Join(r.scope, oldVfsDir)) {
63-
return true
64-
}
65-
6657
return false
6758
}
6859

0 commit comments

Comments
 (0)