Vendoring libnetwork

Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: 92c40f9bc0cd08dd8f8aaee6dd889b955a00dc60
Component: engine
This commit is contained in:
Madhu Venugopal
2016-07-12 11:27:32 -07:00
parent 1da671b499
commit 37b231e040
3 changed files with 7 additions and 2 deletions

View File

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

View File

@ -360,6 +360,10 @@ func (nDB *NetworkDB) bulkSync(nid string, nodes []string, all bool) ([]string,
nodes = nDB.mRandomNodes(1, nodes)
}
if len(nodes) == 0 {
return nil, nil
}
logrus.Debugf("%s: Initiating bulk sync with nodes %v", nDB.config.NodeName, nodes)
var err error
var networks []string