From 03b2393a80ccb2b8e148ee7e4261f4084f98199a Mon Sep 17 00:00:00 2001 From: qudongfang Date: Mon, 26 Nov 2018 13:51:27 +0800 Subject: [PATCH] Improve error if auto-selecting IP-range failed. Signed-off-by: qudongfang --- libnetwork/netutils/utils_linux.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libnetwork/netutils/utils_linux.go b/libnetwork/netutils/utils_linux.go index 10a5e109ee..4c034072d7 100644 --- a/libnetwork/netutils/utils_linux.go +++ b/libnetwork/netutils/utils_linux.go @@ -94,10 +94,12 @@ func ElectInterfaceAddresses(name string) ([]*net.IPNet, []*net.IPNet, error) { } if link == nil || len(v4Nets) == 0 { - // Choose from predefined local scope networks + // Choose from predefined local scope networks v4Net, err := FindAvailableNetwork(ipamutils.PredefinedLocalScopeDefaultNetworks) if err != nil { - return nil, nil, err + return nil, nil, fmt.Errorf("%s, PredefinedLocalScopeDefaultNetworks List: %+v", + err.Error(), + ipamutils.PredefinedLocalScopeDefaultNetworks) } v4Nets = append(v4Nets, v4Net) }