1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Improve error if auto-selecting IP-range failed.

Signed-off-by: qudongfang <qudongfang@gmail.com>
This commit is contained in:
qudongfang 2018-11-26 13:51:27 +08:00
parent 7667c0a4b2
commit 03b2393a80

View file

@ -94,10 +94,12 @@ func ElectInterfaceAddresses(name string) ([]*net.IPNet, []*net.IPNet, error) {
} }
if link == nil || len(v4Nets) == 0 { if link == nil || len(v4Nets) == 0 {
// Choose from predefined local scope networks // Choose from predefined local scope networks
v4Net, err := FindAvailableNetwork(ipamutils.PredefinedLocalScopeDefaultNetworks) v4Net, err := FindAvailableNetwork(ipamutils.PredefinedLocalScopeDefaultNetworks)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, fmt.Errorf("%s, PredefinedLocalScopeDefaultNetworks List: %+v",
err.Error(),
ipamutils.PredefinedLocalScopeDefaultNetworks)
} }
v4Nets = append(v4Nets, v4Net) v4Nets = append(v4Nets, v4Net)
} }