diff --git a/cmd/minikube/cmd/ssh.go b/cmd/minikube/cmd/ssh.go index 15f1d7233613..15621092476b 100644 --- a/cmd/minikube/cmd/ssh.go +++ b/cmd/minikube/cmd/ssh.go @@ -67,6 +67,6 @@ 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, "native-ssh", 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().StringVarP(&nodeName, "node", "n", "", "The node to ssh into. Defaults to the primary control plane.") } diff --git a/pkg/minikube/machine/ssh.go b/pkg/minikube/machine/ssh.go index 0f991e2f2ce2..c547ed09d7d2 100644 --- a/pkg/minikube/machine/ssh.go +++ b/pkg/minikube/machine/ssh.go @@ -42,14 +42,14 @@ func CreateSSHShell(api libmachine.API, cc config.ClusterConfig, n config.Node, return errors.Errorf("%q is not running", machineName) } - client, err := host.CreateSSHClient() - if native { ssh.SetDefaultClient(ssh.Native) } else { ssh.SetDefaultClient(ssh.External) } + client, err := host.CreateSSHClient() + if err != nil { return errors.Wrap(err, "Creating ssh client") }