From 92c40f9bc0cd08dd8f8aaee6dd889b955a00dc60 Mon Sep 17 00:00:00 2001 From: Madhu Venugopal Date: Tue, 12 Jul 2016 11:27:32 -0700 Subject: [PATCH] Vendoring libnetwork Signed-off-by: Madhu Venugopal --- hack/vendor.sh | 2 +- vendor/src/github.com/docker/libnetwork/network.go | 3 ++- vendor/src/github.com/docker/libnetwork/networkdb/cluster.go | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hack/vendor.sh b/hack/vendor.sh index 5898774bc5dd4..0d603d1b9b3d8 100755 --- a/hack/vendor.sh +++ b/hack/vendor.sh @@ -65,7 +65,7 @@ clone git github.com/RackSec/srslog 259aed10dfa74ea2961eddd1d9847619f6e98837 clone git github.com/imdario/mergo 0.2.1 #get libnetwork packages -clone git github.com/docker/libnetwork 6eece7dcc21dcd34d907f3e91dd71cb8640b661c +clone git github.com/docker/libnetwork 9b821dc123ca07e2c4d7244943f4e3e9632904fb clone git github.com/docker/go-events 39718a26497694185f8fb58a7d6f31947f3dc42d clone git github.com/armon/go-radix e39d623f12e8e41c7b5529e9a9dd67a1e2261f80 clone git github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec diff --git a/vendor/src/github.com/docker/libnetwork/network.go b/vendor/src/github.com/docker/libnetwork/network.go index 6063ef085bbe1..09a63615ee803 100644 --- a/vendor/src/github.com/docker/libnetwork/network.go +++ b/vendor/src/github.com/docker/libnetwork/network.go @@ -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. diff --git a/vendor/src/github.com/docker/libnetwork/networkdb/cluster.go b/vendor/src/github.com/docker/libnetwork/networkdb/cluster.go index a627135fc3e27..baf72bf01494a 100644 --- a/vendor/src/github.com/docker/libnetwork/networkdb/cluster.go +++ b/vendor/src/github.com/docker/libnetwork/networkdb/cluster.go @@ -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