From c7d77e9e893e769bced4710cd704b3cd9a43c2fd Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Thu, 18 May 2017 15:06:27 -0700 Subject: [PATCH] Simplify network scope setting logic - in driver(), no need to check for isAgent Signed-off-by: Alessandro Boch --- libnetwork/network.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libnetwork/network.go b/libnetwork/network.go index c082628a30..2b6c705a7b 100644 --- a/libnetwork/network.go +++ b/libnetwork/network.go @@ -904,17 +904,14 @@ func (n *network) driver(load bool) (driverapi.Driver, error) { return nil, err } - c := n.getController() - isAgent := c.isAgent() n.Lock() // If load is not required, driver, cap and err may all be nil if n.scope == "" && cap != nil { n.scope = cap.DataScope } - if isAgent || n.dynamic { - // If we are running in agent mode or the network - // is dynamic, then the networks are swarm scoped - // regardless of the backing driver. + if n.dynamic { + // If the network is dynamic, then it is swarm + // scoped regardless of the backing driver. n.scope = datastore.SwarmScope } n.Unlock()