Skip to content

Commit 3ab2728

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

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"
@@ -506,16 +504,11 @@ func ValidateParamIsUsed(y *LimaYAML) error {
506504
}
507505

508506
func lookupIP(host string) error {
509-
var err error
510507
if strings.HasSuffix(host, ".local") {
511-
var r net.Resolver
512-
const timeout = 500 * time.Millisecond // timeout for .local
513-
ctx, cancel := context.WithTimeout(context.TODO(), timeout)
514-
defer cancel()
515-
_, err = r.LookupIP(ctx, "ip", host)
516-
} else {
517-
_, err = net.LookupIP(host)
508+
// allow offline or slow mDNS
509+
return nil
518510
}
511+
_, err := net.LookupIP(host)
519512
return err
520513
}
521514

0 commit comments

Comments
 (0)