refactor: Introduce IPAM config object

This commit is contained in:
Adam Harrison committed 2016-03-14 17:41:20 +00:00
1 parent 2a10182cf6
commit 2eeb754454
3 files changed
+31 -11

No files matched your search

+9 -1
View File
@@ -366,7 +366,15 @@ func createAllocator(router *mesh.Router, ipRangeStr string, defaultSubnetStr st
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, db, isKnownPeer)
config := ipam.Config{
router.Ourself.Peer.Name,
router.Ourself.Peer.UID,
router.Ourself.Peer.NickName,
ipRange.Range(),
quorum, db, isKnownPeer}
allocator := ipam.NewAllocator(config)
allocator.SetInterfaces(router.NewGossip("IPallocation", allocator))
allocator.Start()