Skip to content

Commit cc436f1

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

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
@@ -4,7 +4,6 @@
44
package limayaml
55

66
import (
7-
"context"
87
"errors"
98
"fmt"
109
"net"
@@ -17,7 +16,6 @@ import (
1716
"strconv"
1817
"strings"
1918
"unicode"
20-
"time"
2119

2220
"github.com/containerd/containerd/identifiers"
2321
"github.com/coreos/go-semver/semver"
@@ -572,16 +570,11 @@ func ValidateParamIsUsed(y *LimaYAML) error {
572570
}
573571

574572
func lookupIP(host string) error {
575-
var err error
576573
if strings.HasSuffix(host, ".local") {
577-
var r net.Resolver
578-
const timeout = 500 * time.Millisecond // timeout for .local
579-
ctx, cancel := context.WithTimeout(context.TODO(), timeout)
580-
defer cancel()
581-
_, err = r.LookupIP(ctx, "ip", host)
582-
} else {
583-
_, err = net.LookupIP(host)
574+
// allow offline or slow mDNS
575+
return nil
584576
}
577+
_, err := net.LookupIP(host)
585578
return err
586579
}
587580

0 commit comments

Comments
 (0)