Resolves issue where docker communicator mishandled symlinks by treating them as files

This commit is contained in:
Israel Shirk 2014-10-27 20:59:21 -06:00
parent ec216a52ef
commit d4080244b0
1 changed files with 10 additions and 0 deletions

View File

@ -117,6 +117,16 @@ func (c *Communicator) UploadDir(dst string, src string, exclude []string) error
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.
src, err := os.Open(path)
if err != nil {