diff --git a/config/config_test.go b/config/config_test.go index 4f37b429..8eb5381f 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -45,7 +45,7 @@ storageEngines: - {{.TmpPluginPath}} config: kvstore: - tableSize: 102134 + tableSize: 1048576 client: dialTimeout: "10s" diff --git a/config/network.go b/config/network.go index 0eb2e974..af625718 100644 --- a/config/network.go +++ b/config/network.go @@ -105,10 +105,20 @@ func getBindIP(ifname, address string) (string, error) { // if we're not bound to a specific IP, let's use a suitable private IP address. ipStr, err := sockaddr.GetPrivateIP() if err != nil { - return "", fmt.Errorf("failed to get interface addresses: %w", err) + return "", fmt.Errorf("failed to get private interface addresses: %w", err) } + + // if we could not find a private address, we need to expand our search to a public + // ip address + if ipStr == "" { + ipStr, err = sockaddr.GetPublicIP() + if err != nil { + return "", fmt.Errorf("failed to get public interface addresses: %w", err) + } + } + if ipStr == "" { - return "", fmt.Errorf("no private IP address found, and explicit IP not provided") + return "", fmt.Errorf("neither private nor public IP address found, and explicit IP not provided") } parsed := net.ParseIP(ipStr)