From 998be42a5203ac61e0df61276563cc01d1c624c4 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 20 Jan 2016 15:33:23 +0000 Subject: [PATCH] Don't crash if no default subnet available --- plugin/ipam/driver.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/ipam/driver.go b/plugin/ipam/driver.go index 766aa9a1..8cd6142f 100644 --- a/plugin/ipam/driver.go +++ b/plugin/ipam/driver.go @@ -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()}