Browse Source

Merge pull request #1318 from mavenugo/nscope

manage network dynamic flag appropriately under various scenarios
Alessandro Boch 9 years ago
parent
commit
e4957174ee
1 changed files with 2 additions and 1 deletions
  1. 2 1
      libnetwork/network.go

+ 2 - 1
libnetwork/network.go

@@ -320,6 +320,7 @@ func (n *network) CopyTo(o datastore.KVObject) error {
 	dstN.id = n.id
 	dstN.id = n.id
 	dstN.networkType = n.networkType
 	dstN.networkType = n.networkType
 	dstN.scope = n.scope
 	dstN.scope = n.scope
+	dstN.dynamic = n.dynamic
 	dstN.ipamType = n.ipamType
 	dstN.ipamType = n.ipamType
 	dstN.enableIPv6 = n.enableIPv6
 	dstN.enableIPv6 = n.enableIPv6
 	dstN.persist = n.persist
 	dstN.persist = n.persist
@@ -706,7 +707,7 @@ func (n *network) driver(load bool) (driverapi.Driver, error) {
 	if cap != nil {
 	if cap != nil {
 		n.scope = cap.DataScope
 		n.scope = cap.DataScope
 	}
 	}
-	if c.isAgent() {
+	if c.isAgent() || n.dynamic {
 		// If we are running in agent mode then all networks
 		// If we are running in agent mode then all networks
 		// in libnetwork are local scope regardless of the
 		// in libnetwork are local scope regardless of the
 		// backing driver.
 		// backing driver.