Merge pull request #2333 from weaveworks/issues/2302-symlink-loop

Check if socket is identical to weave socket after trimming prefix.
This commit is contained in:
Adam Harrison committed 2016-06-06 15:20:23 +01:00
commit eaa4bd1a6c
1 file changed
+2 -2
+2 -2
View File
@@ -611,10 +611,10 @@ func (proxy *Proxy) symlink(unixAddrs []string) (err error) {
binds := []string{"/var/run/weave:/var/run/weave"}
froms := []string{}
for _, addr := range unixAddrs {
if addr == weaveSockUnix {
from := strings.TrimPrefix(addr, "unix://")
if from == weaveSock {
continue
}
from := strings.TrimPrefix(addr, "unix://")
dir := filepath.Dir(from)
binds = append(binds, dir+":"+filepath.Join("/host", dir))
froms = append(froms, filepath.Join("/host", from))