Browse code

Vendoring libnetwork

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 92c40f9bc0cd08dd8f8aaee6dd889b955a00dc60)
Signed-off-by: Tibor Vass <tibor@docker.com>

Madhu Venugopal authored on 2016/07/13 03:27:32
Showing 3 changed files
... ...
@@ -65,7 +65,7 @@ clone git github.com/RackSec/srslog 259aed10dfa74ea2961eddd1d9847619f6e98837
65 65
 clone git github.com/imdario/mergo 0.2.1
66 66
 
67 67
 #get libnetwork packages
68
-clone git github.com/docker/libnetwork 6eece7dcc21dcd34d907f3e91dd71cb8640b661c
68
+clone git github.com/docker/libnetwork 9b821dc123ca07e2c4d7244943f4e3e9632904fb
69 69
 clone git github.com/docker/go-events 39718a26497694185f8fb58a7d6f31947f3dc42d
70 70
 clone git github.com/armon/go-radix e39d623f12e8e41c7b5529e9a9dd67a1e2261f80
71 71
 clone git github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec
... ...
@@ -320,6 +320,7 @@ func (n *network) CopyTo(o datastore.KVObject) error {
320 320
 	dstN.id = n.id
321 321
 	dstN.networkType = n.networkType
322 322
 	dstN.scope = n.scope
323
+	dstN.dynamic = n.dynamic
323 324
 	dstN.ipamType = n.ipamType
324 325
 	dstN.enableIPv6 = n.enableIPv6
325 326
 	dstN.persist = n.persist
... ...
@@ -706,7 +707,7 @@ func (n *network) driver(load bool) (driverapi.Driver, error) {
706 706
 	if cap != nil {
707 707
 		n.scope = cap.DataScope
708 708
 	}
709
-	if c.isAgent() {
709
+	if c.isAgent() || n.dynamic {
710 710
 		// If we are running in agent mode then all networks
711 711
 		// in libnetwork are local scope regardless of the
712 712
 		// backing driver.
... ...
@@ -360,6 +360,10 @@ func (nDB *NetworkDB) bulkSync(nid string, nodes []string, all bool) ([]string,
360 360
 		nodes = nDB.mRandomNodes(1, nodes)
361 361
 	}
362 362
 
363
+	if len(nodes) == 0 {
364
+		return nil, nil
365
+	}
366
+
363 367
 	logrus.Debugf("%s: Initiating bulk sync with nodes %v", nDB.config.NodeName, nodes)
364 368
 	var err error
365 369
 	var networks []string