From fd99260ae7eeea2d174b798691d19a0a2ecb4438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Mon, 2 Mar 2020 19:10:03 +0100 Subject: [PATCH] Fix native-ssh flag for the ssh command --- cmd/minikube/cmd/ssh.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/minikube/cmd/ssh.go b/cmd/minikube/cmd/ssh.go index 84dead06e104..d364eaaab06f 100644 --- a/cmd/minikube/cmd/ssh.go +++ b/cmd/minikube/cmd/ssh.go @@ -30,6 +30,10 @@ import ( "k8s.io/minikube/pkg/minikube/out" ) +var ( + nativeSSHClient bool +) + // sshCmd represents the docker-ssh command var sshCmd = &cobra.Command{ Use: "ssh", @@ -52,7 +56,7 @@ var sshCmd = &cobra.Command{ if host.Driver.DriverName() == driver.None { exit.UsageT("'none' driver does not support 'minikube ssh' command") } - if viper.GetBool(nativeSSH) { + if nativeSSHClient { ssh.SetDefaultClient(ssh.Native) } else { ssh.SetDefaultClient(ssh.External) @@ -69,5 +73,5 @@ var sshCmd = &cobra.Command{ } func init() { - sshCmd.Flags().Bool(nativeSSH, true, "Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'.") + sshCmd.Flags().BoolVar(&nativeSSHClient, nativeSSH, true, "Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'.") }