From 36ba838f548ef3aa572b2e1582794ab1585f99c9 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sun, 14 Jun 2015 13:44:27 +0100 Subject: [PATCH] remove ipam.DummyAllocator and rely on new SurrogateGossiper As a result it is possible to mix nodes with and without IPAM. Note that the quorum only involves the former, and hence such mixed environments will typically require a custom `-initpeercount`. --- ipam/dummy.go | 32 -------------------------------- prog/weaver/main.go | 2 -- 2 files changed, 34 deletions(-) delete mode 100644 ipam/dummy.go diff --git a/ipam/dummy.go b/ipam/dummy.go deleted file mode 100644 index 35d6898b..00000000 --- a/ipam/dummy.go +++ /dev/null @@ -1,32 +0,0 @@ -package ipam - -import ( - "errors" - - "github.com/weaveworks/weave/router" -) - -// Exists solely for the purpose of detecting a network in which some -// peers are configured with IPAM on and some with IPAM off. -type DummyAllocator struct { -} - -var ( - ErrMixedConfig = errors.New("Mixed IPAM/non-IPAM configuration not supported") -) - -func (alloc *DummyAllocator) OnGossipUnicast(sender router.PeerName, msg []byte) error { - return ErrMixedConfig -} - -func (alloc *DummyAllocator) OnGossipBroadcast(msg []byte) (router.GossipData, error) { - return nil, ErrMixedConfig -} - -func (alloc *DummyAllocator) OnGossip(msg []byte) (router.GossipData, error) { - return nil, ErrMixedConfig -} - -func (alloc *DummyAllocator) Gossip() router.GossipData { - return nil -} diff --git a/prog/weaver/main.go b/prog/weaver/main.go index 25fdad75..d0ac8596 100644 --- a/prog/weaver/main.go +++ b/prog/weaver/main.go @@ -153,8 +153,6 @@ func main() { } } else if peerCount > 0 { log.Fatal("-initpeercount flag specified without -iprange") - } else { - router.NewGossip("IPallocation", &ipam.DummyAllocator{}) } router.Start()