Skip to content

Commit 3541b35

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

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/coreos/go-semver/semver"
1816
"github.com/docker/go-units"
@@ -512,16 +510,11 @@ func ValidateParamIsUsed(y *LimaYAML) error {
512510
}
513511

514512
func lookupIP(host string) error {
515-
var err error
516513
if strings.HasSuffix(host, ".local") {
517-
var r net.Resolver
518-
const timeout = 500 * time.Millisecond // timeout for .local
519-
ctx, cancel := context.WithTimeout(context.TODO(), timeout)
520-
defer cancel()
521-
_, err = r.LookupIP(ctx, "ip", host)
522-
} else {
523-
_, err = net.LookupIP(host)
514+
// allow offline or slow mDNS
515+
return nil
524516
}
517+
_, err := net.LookupIP(host)
525518
return err
526519
}
527520

0 commit comments

Comments
 (0)