When container is started in host (or container) networkMode, we mount a noop weavewait, so it can continue
review feedback
This commit is contained in:
1 parent
77c7963bde
commit
ec5a1a3977
12 files changed
+106
-42
No files matched your search
@@ -155,3 +155,25 @@ func weaveContainerIPs(containerID string) (mac string, ips []net.IP, nets []*ne
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func addVolume(hostConfig jsonObject, source, target, mode string) error {
|
||||
configBinds, err := hostConfig.StringArray("Binds")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var binds []string
|
||||
for _, bind := range configBinds {
|
||||
s := strings.Split(bind, ":")
|
||||
if len(s) >= 2 && s[1] == target {
|
||||
continue
|
||||
}
|
||||
binds = append(binds, bind)
|
||||
}
|
||||
bind := source + ":" + target
|
||||
if mode != "" {
|
||||
bind += ":" + mode
|
||||
}
|
||||
hostConfig["Binds"] = append(binds, bind)
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user