1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Vendoring libnetwork

Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
Madhu Venugopal 2017-05-18 15:14:12 -07:00
parent da9a885483
commit 9b0e1df4dd
3 changed files with 10 additions and 9 deletions

View file

@ -26,7 +26,7 @@ github.com/imdario/mergo 0.2.1
golang.org/x/sync de49d9dcd27d4f764488181bea099dfe6179bcf0 golang.org/x/sync de49d9dcd27d4f764488181bea099dfe6179bcf0
#get libnetwork packages #get libnetwork packages
github.com/docker/libnetwork b2bc1a68486ccf8ada503162d9f0df7d31bdd8fb github.com/docker/libnetwork 83e1e49475b88a9f1f8ba89a690a7d5de42e24b9
github.com/docker/go-events 18b43f1bc85d9cdd42c05a6cd2d444c7a200a894 github.com/docker/go-events 18b43f1bc85d9cdd42c05a6cd2d444c7a200a894
github.com/armon/go-radix e39d623f12e8e41c7b5529e9a9dd67a1e2261f80 github.com/armon/go-radix e39d623f12e8e41c7b5529e9a9dd67a1e2261f80
github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec

View file

@ -765,6 +765,10 @@ func (c *controller) NewNetwork(networkType, name string, id string, options ...
return nil, types.ForbiddenErrorf("Cannot create a multi-host network from a worker node. Please create the network from a manager node.") return nil, types.ForbiddenErrorf("Cannot create a multi-host network from a worker node. Please create the network from a manager node.")
} }
if network.scope == datastore.SwarmScope && c.isDistributedControl() {
return nil, types.ForbiddenErrorf("cannot create a swarm scoped network when swarm is not active")
}
// Make sure we have a driver available for this network type // Make sure we have a driver available for this network type
// before we allocate anything. // before we allocate anything.
if _, err := network.driver(true); err != nil { if _, err := network.driver(true); err != nil {

View file

@ -356,10 +356,10 @@ func (n *network) validateConfiguration() error {
if n.configOnly { if n.configOnly {
// Only supports network specific configurations. // Only supports network specific configurations.
// Network operator configurations are not supported. // Network operator configurations are not supported.
if n.ingress || n.internal || n.attachable { if n.ingress || n.internal || n.attachable || n.scope != "" {
return types.ForbiddenErrorf("configuration network can only contain network " + return types.ForbiddenErrorf("configuration network can only contain network " +
"specific fields. Network operator fields like " + "specific fields. Network operator fields like " +
"[ ingress | internal | attachable ] are not supported.") "[ ingress | internal | attachable | scope ] are not supported.")
} }
} }
if n.configFrom != "" { if n.configFrom != "" {
@ -904,17 +904,14 @@ func (n *network) driver(load bool) (driverapi.Driver, error) {
return nil, err return nil, err
} }
c := n.getController()
isAgent := c.isAgent()
n.Lock() n.Lock()
// If load is not required, driver, cap and err may all be nil // If load is not required, driver, cap and err may all be nil
if n.scope == "" && cap != nil { if n.scope == "" && cap != nil {
n.scope = cap.DataScope n.scope = cap.DataScope
} }
if isAgent && n.dynamic { if n.dynamic {
// If we are running in agent mode and the network // If the network is dynamic, then it is swarm
// is dynamic, then the networks are swarm scoped // scoped regardless of the backing driver.
// regardless of the backing driver.
n.scope = datastore.SwarmScope n.scope = datastore.SwarmScope
} }
n.Unlock() n.Unlock()