Return fake 'gateway address' to avoid requiring consensus during initialization

This commit is contained in:
Bryan Boreham committed 2015-12-15 16:52:37 +00:00
1 parent 776ccac00a
commit 791fc9d6b1
1 file changed
+5 -1
+5 -1
View File
@@ -4,6 +4,7 @@ import (
"net"
"github.com/docker/libnetwork/ipamapi"
"github.com/docker/libnetwork/netlabel"
"github.com/weaveworks/weave/api"
. "github.com/weaveworks/weave/common"
"github.com/weaveworks/weave/common/docker"
@@ -32,7 +33,10 @@ func (i *ipam) RequestPool(addressSpace, pool, subPool string, options map[strin
Log.Debugln("RequestPool", addressSpace, pool, subPool, options)
cidr, err := i.weave.DefaultSubnet()
Log.Debugln("RequestPool returning ", cidr, err)
return "weavepool", cidr, nil, err
// Pass back a fake "gateway address"; we don't actually use it,
// so just give the network address.
data := map[string]string{netlabel.Gateway: cidr.String()}
return "weavepool", cidr, data, err
}
func (i *ipam) ReleasePool(poolID string) error {