mirror of https://github.com/docker/cli.git
Partial fix for #2648 on Windows only.
Signed-off-by: Eric <ericwj@users.noreply.github.com>
This commit is contained in:
parent
280e7230d5
commit
c2e2c0b9f6
|
@ -280,13 +280,9 @@ func ResolveAndValidateContextPath(givenContextDir string) (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// The context dir might be a symbolic link, so follow it to the actual
|
// The context dir might be a symbolic link, so follow it to the actual
|
||||||
// target directory.
|
// target directory. This still forgets the configured context directory,
|
||||||
//
|
// but leave this for now on *nix only.
|
||||||
// FIXME. We use isUNC (always false on non-Windows platforms) to workaround
|
if runtime.GOOS != "windows" {
|
||||||
// an issue in golang. On Windows, EvalSymLinks does not work on UNC file
|
|
||||||
// paths (those starting with \\). This hack means that when using links
|
|
||||||
// on UNC paths, they will not be followed.
|
|
||||||
if !isUNC(absContextDir) {
|
|
||||||
absContextDir, err = filepath.EvalSymlinks(absContextDir)
|
absContextDir, err = filepath.EvalSymlinks(absContextDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Errorf("unable to evaluate symlinks in context path: %v", err)
|
return "", errors.Errorf("unable to evaluate symlinks in context path: %v", err)
|
||||||
|
|
Loading…
Reference in New Issue