Skip to content

Commit 9d6ebeb

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 e7688d6 commit 9d6ebeb

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/containerd/containerd/identifiers"
1816
"github.com/coreos/go-semver/semver"
@@ -513,16 +511,11 @@ func ValidateParamIsUsed(y *LimaYAML) error {
513511
}
514512

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

0 commit comments

Comments
 (0)