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:
parent
7667c0a4b2
commit
03b2393a80
1 changed files with 4 additions and 2 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue