Resolves issue where docker communicator mishandled symlinks by treating them as files
This commit is contained in:
parent
ec216a52ef
commit
d4080244b0
|
@ -117,6 +117,16 @@ func (c *Communicator) UploadDir(dst string, src string, exclude []string) error
|
||||||
return os.MkdirAll(hostpath, info.Mode())
|
return os.MkdirAll(hostpath, info.Mode())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if info.Mode() & os.ModeSymlink == os.ModeSymlink {
|
||||||
|
dest, err := os.Readlink(path)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return os.Symlink(dest, hostpath)
|
||||||
|
}
|
||||||
|
|
||||||
// It is a file, copy it over, including mode.
|
// It is a file, copy it over, including mode.
|
||||||
src, err := os.Open(path)
|
src, err := os.Open(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue