mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
pkg/system: deprecate IsAbs and move internal
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/containerd/log"
|
||||
@@ -19,7 +20,6 @@ import (
|
||||
"github.com/docker/docker/image"
|
||||
"github.com/docker/docker/oci/caps"
|
||||
"github.com/docker/docker/opts"
|
||||
"github.com/docker/docker/pkg/system"
|
||||
volumemounts "github.com/docker/docker/volume/mounts"
|
||||
"github.com/docker/go-connections/nat"
|
||||
"github.com/moby/sys/signal"
|
||||
@@ -369,7 +369,7 @@ func translateWorkingDir(config *containertypes.Config) error {
|
||||
return nil
|
||||
}
|
||||
wd := filepath.FromSlash(config.WorkingDir) // Ensure in platform semantics
|
||||
if !system.IsAbs(wd) {
|
||||
if !filepath.IsAbs(wd) && !strings.HasPrefix(wd, string(os.PathSeparator)) {
|
||||
return fmt.Errorf("the working directory '%s' is invalid, it needs to be an absolute path", config.WorkingDir)
|
||||
}
|
||||
config.WorkingDir = filepath.Clean(wd)
|
||||
|
||||
Reference in New Issue
Block a user