We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e0b29cc + a6cf000 commit d610464Copy full SHA for d610464
pkg/util/util.go
@@ -33,10 +33,11 @@ import (
33
34
func GetLocalIP(hostName string) (string, error) {
35
var ipAddr net.IP
36
- addrs, err := net.LookupIP(hostName)
37
- if err != nil {
38
- return "", err
39
- }
+ var err error
+
+ // If looks up host failed, will use utilnet.ChooseHostInterface() below,
+ // So ignore the error here
40
+ addrs, _ := net.LookupIP(hostName)
41
for _, addr := range addrs {
42
if err := ValidateNodeIP(addr); err != nil {
43
continue
@@ -49,6 +50,7 @@ func GetLocalIP(hostName string) (string, error) {
49
50
ipAddr = addr
51
}
52
53
54
if ipAddr == nil {
55
ipAddr, err = utilnet.ChooseHostInterface()
56
if err != nil {
0 commit comments