1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-20 02:49:08 +00:00

Skip check for private key if using ssh agent

This commit is contained in:
galal-hussein
2018-08-28 21:44:06 +02:00
committed by Alena Prokharchyk
parent 4b3068d673
commit 8f47078988

View File

@@ -40,7 +40,7 @@ func newDialer(h *Host, kind string) (*dialer, error) {
netConn: "tcp", netConn: "tcp",
useSSHAgentAuth: h.SSHAgentAuth, useSSHAgentAuth: h.SSHAgentAuth,
} }
if bastionDialer.sshKeyString == "" { if bastionDialer.sshKeyString == "" && !bastionDialer.useSSHAgentAuth {
var err error var err error
bastionDialer.sshKeyString, err = privateKeyPath(h.BastionHost.SSHKeyPath) bastionDialer.sshKeyString, err = privateKeyPath(h.BastionHost.SSHKeyPath)
if err != nil { if err != nil {
@@ -59,7 +59,7 @@ func newDialer(h *Host, kind string) (*dialer, error) {
bastionDialer: bastionDialer, bastionDialer: bastionDialer,
} }
if dialer.sshKeyString == "" { if dialer.sshKeyString == "" && !dialer.useSSHAgentAuth {
var err error var err error
dialer.sshKeyString, err = privateKeyPath(h.SSHKeyPath) dialer.sshKeyString, err = privateKeyPath(h.SSHKeyPath)
if err != nil { if err != nil {