Don't crash if no default subnet available

This commit is contained in:
Bryan Boreham committed 2016-01-20 15:36:25 +00:00
1 parent 13ec517f94
commit 998be42a52
1 file changed
+3
+3
View File
@@ -33,6 +33,9 @@ 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)
if err != nil {
return "", nil, 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()}