瀏覽代碼

Removing the override for ipamdriver for local scope networks

The commit contains fix for the issue reported in
https://github.com/moby/moby/issues/33415 and
https://github.com/docker/libnetwork/issues/1772. With the
feature introduced to support local scope networks in swarm
mode the network configuration to include ipam driver was overriden
in libnetwork. This has been removed with this fix which will allow
ipam-driver option to be used for task allocation

Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
Abhinandan Prativadi 8 年之前
父節點
當前提交
26fb58d3a8
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 0 1
      libnetwork/controller.go
  2. 3 0
      libnetwork/network.go

+ 0 - 1
libnetwork/controller.go

@@ -738,7 +738,6 @@ func (c *controller) NewNetwork(networkType, name string, id string, options ...
 	if network.configOnly {
 	if network.configOnly {
 		network.scope = datastore.LocalScope
 		network.scope = datastore.LocalScope
 		network.networkType = "null"
 		network.networkType = "null"
-		network.ipamType = ""
 		goto addToStore
 		goto addToStore
 	}
 	}
 
 

+ 3 - 0
libnetwork/network.go

@@ -412,6 +412,9 @@ func (n *network) applyConfigurationTo(to *network) error {
 			}
 			}
 		}
 		}
 	}
 	}
+	if len(n.ipamType) != 0 {
+		to.ipamType = n.ipamType
+	}
 	if len(n.ipamOptions) > 0 {
 	if len(n.ipamOptions) > 0 {
 		to.ipamOptions = make(map[string]string, len(n.ipamOptions))
 		to.ipamOptions = make(map[string]string, len(n.ipamOptions))
 		for k, v := range n.ipamOptions {
 		for k, v := range n.ipamOptions {