Let IPAM pick any peer we know about to transfer ownership to, when shutting down

This commit is contained in:
Bryan Boreham committed 2015-11-02 18:34:58 +00:00
1 parent 2bbe6a2ad8
commit b3cda39b0b
4 files changed
+39 -4

No files matched your search

+2 -1
View File
@@ -368,7 +368,8 @@ func createAllocator(router *weave.Router, ipRangeStr string, defaultSubnetStr s
Log.Fatalf("IP address allocation default subnet %s does not overlap with allocation range %s", defaultSubnet, ipRange)
}
}
allocator := ipam.NewAllocator(router.Ourself.Peer.Name, router.Ourself.Peer.UID, router.Ourself.Peer.NickName, ipRange.Range(), quorum)
namesFunc := func() map[weave.PeerName]struct{} { return router.Peers.Names() }
allocator := ipam.NewAllocator(router.Ourself.Peer.Name, router.Ourself.Peer.UID, router.Ourself.Peer.NickName, ipRange.Range(), quorum, namesFunc)
allocator.SetInterfaces(router.NewGossip("IPallocation", allocator))
allocator.Start()