More extensive choice of transferee

This commit is contained in:
Bryan Boreham committed 2015-11-03 12:03:28 +00:00
1 parent 27c5f5f49f
commit ace372cfc6
4 files changed
+45 -28

No files matched your search

+2 -2
View File
@@ -368,8 +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)
}
}
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)
isValidFunc := func(name weave.PeerName) bool { return router.Peers.Fetch(name) != nil }
allocator := ipam.NewAllocator(router.Ourself.Peer.Name, router.Ourself.Peer.UID, router.Ourself.Peer.NickName, ipRange.Range(), quorum, isValidFunc)
allocator.SetInterfaces(router.NewGossip("IPallocation", allocator))
allocator.Start()