Merge pull request #6858 from afbjorklund/ssh-native

Fix native-ssh flag for the ssh command
pull/6864/head
Medya Ghazizadeh 2020-03-02 13:19:34 -08:00 committed by GitHub
commit 16388a2adc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -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'.")
}