From 5d8e9dbfc5a88002f678e00b9a3810dbac8d1caf Mon Sep 17 00:00:00 2001 From: tstromberg Date: Wed, 8 Jan 2020 11:23:15 -0800 Subject: [PATCH 1/3] Support --force for overriding the ssh check --- cmd/minikube/cmd/start.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index d8b8b594967d..7143674c67a5 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -1097,19 +1097,23 @@ func trySSH(h *host.Host, ip string) { } if err := retry.Expo(dial, time.Second, 13*time.Second); err != nil { - exit.WithCodeT(exit.IO, `minikube is unable to connect to the VM: {{.error}} + if !viper.GetBool(force) { + exit.WithCodeT(exit.IO, `minikube is unable to connect to the VM: {{.error}} -This is likely due to one of two reasons: + This is likely due to one of two reasons: -- VPN or firewall interference -- {{.hypervisor}} network configuration issue + - VPN or firewall interference + - {{.hypervisor}} network configuration issue -Suggested workarounds: + Suggested workarounds: -- Disable your local VPN or firewall software -- Configure your local VPN or firewall to allow access to {{.ip}} -- Restart or reinstall {{.hypervisor}} -- Use an alternative --vm-driver`, out.V{"error": err, "hypervisor": h.Driver.DriverName(), "ip": ip}) + - Disable your local VPN or firewall software + - Configure your local VPN or firewall to allow access to {{.ip}} + - Restart or reinstall {{.hypervisor}} + - Use an alternative --vm-driver + - Use --force to override this connectivity check + `, out.V{"error": err, "hypervisor": h.Driver.DriverName(), "ip": ip}) + } } } From 9b5044bfb2e3ff721bde0bb90de9317f6ab27907 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Fri, 31 Jan 2020 14:53:04 -0800 Subject: [PATCH 2/3] Skip trySSH entirely if --force is set --- cmd/minikube/cmd/start.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 7143674c67a5..deecadb027aa 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -1083,6 +1083,10 @@ func validateNetwork(h *host.Host, r command.Runner) string { } func trySSH(h *host.Host, ip string) { + if viper.GetBool(force) { + return + } + sshAddr := net.JoinHostPort(ip, "22") dial := func() (err error) { @@ -1097,8 +1101,7 @@ func trySSH(h *host.Host, ip string) { } if err := retry.Expo(dial, time.Second, 13*time.Second); err != nil { - if !viper.GetBool(force) { - exit.WithCodeT(exit.IO, `minikube is unable to connect to the VM: {{.error}} + exit.WithCodeT(exit.IO, `minikube is unable to connect to the VM: {{.error}} This is likely due to one of two reasons: From 7ebd01e113bc3a39193d9b3f214b2eb41d188014 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Fri, 31 Jan 2020 14:55:24 -0800 Subject: [PATCH 3/3] Remove extra } --- cmd/minikube/cmd/start.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 4d9b8b9520b5..b353a6d8786d 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -1155,7 +1155,6 @@ func trySSH(h *host.Host, ip string) { - Use an alternative --vm-driver - Use --force to override this connectivity check `, out.V{"error": err, "hypervisor": h.Driver.DriverName(), "ip": ip}) - } } }