Skip to content

Commit 86ea0de

Browse files
committed
Allow .local hosts to be offline or slow
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
1 parent 19469eb commit 86ea0de

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

pkg/limayaml/validate.go

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package limayaml
22

33
import (
4-
"context"
54
"errors"
65
"fmt"
76
"net"
@@ -11,7 +10,6 @@ import (
1110
"regexp"
1211
"runtime"
1312
"strings"
14-
"time"
1513

1614
"github.com/docker/go-units"
1715
"github.com/lima-vm/lima/pkg/localpathutil"
@@ -439,16 +437,11 @@ func ValidateParamIsUsed(y *LimaYAML) error {
439437
}
440438

441439
func lookupIP(host string) error {
442-
var err error
443440
if strings.HasSuffix(host, ".local") {
444-
var r net.Resolver
445-
const timeout = 500 * time.Millisecond // timeout for .local
446-
ctx, cancel := context.WithTimeout(context.TODO(), timeout)
447-
defer cancel()
448-
_, err = r.LookupIP(ctx, "ip", host)
449-
} else {
450-
_, err = net.LookupIP(host)
441+
// allow offline or slow mDNS
442+
return nil
451443
}
444+
_, err := net.LookupIP(host)
452445
return err
453446
}
454447

0 commit comments

Comments
 (0)