Skip to content

Commit

Permalink
Merge pull request #6858 from afbjorklund/ssh-native
Browse files Browse the repository at this point in the history
Fix native-ssh flag for the ssh command
  • Loading branch information
medyagh authored Mar 2, 2020
2 parents b8941d4 + fd99260 commit 16388a2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/minikube/cmd/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)
Expand All @@ -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'.")
}

0 comments on commit 16388a2

Please sign in to comment.