[proxy] attach containers with --net=none to weave
This commit is contained in:
1 parent
eaa5385069
commit
0de292c0d4
2 files changed
+12
-13
No files matched your search
+6
-5
@@ -225,11 +225,12 @@ func (proxy *Proxy) listen(protoAndAddr string) (net.Listener, string, error) {
|
||||
}
|
||||
|
||||
func (proxy *Proxy) weaveCIDRsFromConfig(config *docker.Config, hostConfig *docker.HostConfig) ([]string, error) {
|
||||
if hostConfig != nil &&
|
||||
hostConfig.NetworkMode != "" &&
|
||||
hostConfig.NetworkMode != "default" &&
|
||||
hostConfig.NetworkMode != "bridge" {
|
||||
return nil, fmt.Errorf("--net option: %q", hostConfig.NetworkMode)
|
||||
netMode := ""
|
||||
if hostConfig != nil {
|
||||
netMode = hostConfig.NetworkMode
|
||||
}
|
||||
if netMode == "host" || strings.HasPrefix(netMode, "container:") {
|
||||
return nil, fmt.Errorf("--net option: %q", netMode)
|
||||
}
|
||||
for _, e := range config.Env {
|
||||
if strings.HasPrefix(e, "WEAVE_CIDR=") {
|
||||
|
||||
Reference in new issue
Block a user