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

On agent init, re-join on existing cluster networks

Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
Alessandro Boch 2016-07-12 17:35:32 -07:00
parent e4957174ee
commit d0192db0cd
2 changed files with 12 additions and 5 deletions

View file

@ -358,6 +358,8 @@ func (c *controller) agentInit(bindAddrOrInterface string) error {
return false return false
}) })
c.WalkNetworks(joinCluster)
return nil return nil
} }

View file

@ -639,15 +639,20 @@ func (c *controller) NewNetwork(networkType, name string, id string, options ...
return nil, err return nil, err
} }
if err = network.joinCluster(); err != nil { joinCluster(network)
log.Errorf("Failed to join network %s into agent cluster: %v", name, err)
}
network.addDriverWatches()
return network, nil return network, nil
} }
var joinCluster NetworkWalker = func(nw Network) bool {
n := nw.(*network)
if err := n.joinCluster(); err != nil {
log.Errorf("Failed to join network %s (%s) into agent cluster: %v", n.Name(), n.ID(), err)
}
n.addDriverWatches()
return false
}
func (c *controller) reservePools() { func (c *controller) reservePools() {
networks, err := c.getNetworksForScope(datastore.LocalScope) networks, err := c.getNetworksForScope(datastore.LocalScope)
if err != nil { if err != nil {