Commit 1954cc97 authored by Seth Vargo's avatar Seth Vargo

Merge pull request #1628 from israelshirk/hotfix/docker-communicator-symlink

Fixes Docker communicator mishandling of symlinks in UploadDir()
parents 96c81368 d4080244
...@@ -117,6 +117,16 @@ func (c *Communicator) UploadDir(dst string, src string, exclude []string) error ...@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment