Skip to content

Commit 8dc8714

Browse files
committed
Allow .local hosts to be offline or slow
Signed-off-by: Anders F Björklund <[email protected]>
1 parent eec5726 commit 8dc8714

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"
@@ -12,7 +11,6 @@ import (
1211
"runtime"
1312
"strings"
1413
"unicode"
15-
"time"
1614

1715
"github.com/docker/go-units"
1816
"github.com/lima-vm/lima/pkg/localpathutil"
@@ -476,16 +474,11 @@ func ValidateParamIsUsed(y *LimaYAML) error {
476474
}
477475

478476
func lookupIP(host string) error {
479-
var err error
480477
if strings.HasSuffix(host, ".local") {
481-
var r net.Resolver
482-
const timeout = 500 * time.Millisecond // timeout for .local
483-
ctx, cancel := context.WithTimeout(context.TODO(), timeout)
484-
defer cancel()
485-
_, err = r.LookupIP(ctx, "ip", host)
486-
} else {
487-
_, err = net.LookupIP(host)
478+
// allow offline or slow mDNS
479+
return nil
488480
}
481+
_, err := net.LookupIP(host)
489482
return err
490483
}
491484

0 commit comments

Comments
 (0)