pkg/system: move CheckSystemDriveAndRemoveDriveLetter to pkg/archive
This one is a "bit" fuzzy, as it may not be _directly_ related to `archive`, but it's always used _in combination_ with the archive package, so moving it there. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
c4872b4519
commit
fb77973201
6 changed files with 7 additions and 12 deletions
container
daemon
pkg/archive
|
@ -6,7 +6,6 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/pkg/archive"
|
||||
"github.com/docker/docker/pkg/system"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
@ -18,8 +17,8 @@ func (container *Container) ResolvePath(path string) (resolvedPath, absPath stri
|
|||
if container.BaseFS == "" {
|
||||
return "", "", errors.New("ResolvePath: BaseFS of container " + container.ID + " is unexpectedly empty")
|
||||
}
|
||||
// Check if a drive letter supplied, it must be the system drive.
|
||||
path, err = system.CheckSystemDriveAndRemoveDriveLetter(path)
|
||||
// Check if a drive letter supplied, it must be the system drive. No-op except on Windows
|
||||
path, err = archive.CheckSystemDriveAndRemoveDriveLetter(path)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ import (
|
|||
"github.com/docker/docker/pkg/archive"
|
||||
"github.com/docker/docker/pkg/chrootarchive"
|
||||
"github.com/docker/docker/pkg/ioutils"
|
||||
"github.com/docker/docker/pkg/system"
|
||||
)
|
||||
|
||||
// containerStatPath stats the filesystem resource at the specified path in this
|
||||
|
@ -172,7 +171,7 @@ func (daemon *Daemon) containerExtractToDir(container *container.Container, path
|
|||
path = filepath.FromSlash(path)
|
||||
|
||||
// Check if a drive letter supplied, it must be the system drive. No-op except on Windows
|
||||
path, err = system.CheckSystemDriveAndRemoveDriveLetter(path)
|
||||
path, err = archive.CheckSystemDriveAndRemoveDriveLetter(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package system // import "github.com/docker/docker/pkg/system"
|
||||
package archive
|
||||
|
||||
// CheckSystemDriveAndRemoveDriveLetter verifies that a path, if it includes a drive letter,
|
||||
// is the system drive.
|
|
@ -1,7 +1,7 @@
|
|||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package system // import "github.com/docker/docker/pkg/system"
|
||||
package archive
|
||||
|
||||
// checkSystemDriveAndRemoveDriveLetter is the non-Windows implementation
|
||||
// of CheckSystemDriveAndRemoveDriveLetter
|
|
@ -1,4 +1,4 @@
|
|||
package system // import "github.com/docker/docker/pkg/system"
|
||||
package archive
|
||||
|
||||
import (
|
||||
"fmt"
|
|
@ -1,7 +1,4 @@
|
|||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package system // import "github.com/docker/docker/pkg/system"
|
||||
package archive
|
||||
|
||||
import (
|
||||
"testing"
|
Loading…
Add table
Reference in a new issue