Skip to content

Commit

Permalink
Fix "--native-ssh" flag of "minikube ssh"
Browse files Browse the repository at this point in the history
In the previous state, the flag was discarded. This commit fixes
that and also makes sure that the SSH client is created after the
default client type is configured according to the flag.
  • Loading branch information
joshmue committed Oct 9, 2020
1 parent 1fd1f67 commit 8cfe5c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}
4 changes: 2 additions & 2 deletions pkg/minikube/machine/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 8cfe5c1

Please sign in to comment.