From 91bb60b45a9b90069ed61ef06f97090d474c1e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Tue, 9 Jul 2024 20:28:47 +0200 Subject: [PATCH] Allow .local hosts to be offline or slow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anders F Björklund --- pkg/limayaml/validate.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/pkg/limayaml/validate.go b/pkg/limayaml/validate.go index 1107d1132730..646caa8e556d 100644 --- a/pkg/limayaml/validate.go +++ b/pkg/limayaml/validate.go @@ -1,7 +1,6 @@ package limayaml import ( - "context" "errors" "fmt" "net" @@ -10,7 +9,6 @@ import ( "path/filepath" "runtime" "strings" - "time" "github.com/docker/go-units" "github.com/lima-vm/lima/pkg/localpathutil" @@ -398,16 +396,11 @@ func validateNetwork(y *LimaYAML) error { } func lookupIP(host string) error { - var err error if strings.HasSuffix(host, ".local") { - var r net.Resolver - const timeout = 500 * time.Millisecond // timeout for .local - ctx, cancel := context.WithTimeout(context.TODO(), timeout) - defer cancel() - _, err = r.LookupIP(ctx, "ip", host) - } else { - _, err = net.LookupIP(host) + // allow offline or slow mDNS + return nil } + _, err := net.LookupIP(host) return err }