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:
parent
e4957174ee
commit
d0192db0cd
2 changed files with 12 additions and 5 deletions
|
@ -358,6 +358,8 @@ func (c *controller) agentInit(bindAddrOrInterface string) error {
|
|||
return false
|
||||
})
|
||||
|
||||
c.WalkNetworks(joinCluster)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -639,15 +639,20 @@ func (c *controller) NewNetwork(networkType, name string, id string, options ...
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if err = network.joinCluster(); err != nil {
|
||||
log.Errorf("Failed to join network %s into agent cluster: %v", name, err)
|
||||
}
|
||||
|
||||
network.addDriverWatches()
|
||||
joinCluster(network)
|
||||
|
||||
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() {
|
||||
networks, err := c.getNetworksForScope(datastore.LocalScope)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue