From 7b324055e1b57e46fac715d38afeeef2ee5e6aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Qi=CE=BC=24hi=D0=AFu=C3=AD?= <39378935+srstack@users.noreply.github.com> Date: Thu, 9 Jun 2022 14:48:31 +0800 Subject: [PATCH] fix fillHostArchOrOS not working when using Identity (#1914) --- pkg/cluster/manager/manager.go | 43 ++++++++++++++++------------------ 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/pkg/cluster/manager/manager.go b/pkg/cluster/manager/manager.go index 3740a30ea0..7eb9170541 100644 --- a/pkg/cluster/manager/manager.go +++ b/pkg/cluster/manager/manager.go @@ -195,29 +195,26 @@ func (m *Manager) fillHostArchOrOS(s, p *tui.SSHConnectionProps, topo spec.Topol } hostArchOrOS[inst.GetHost()] = "" - tf := task.NewSimpleUerSSH(m.logger, inst.GetHost(), inst.GetSSHPort(), user, *gOpt, p, globalSSHType) - if s.Password != "" || user == "root" { - tf = task.NewBuilder(m.logger). - RootSSH( - inst.GetHost(), - inst.GetSSHPort(), - user, - s.Password, - s.IdentityFile, - s.IdentityFilePassphrase, - gOpt.SSHTimeout, - gOpt.OptTimeout, - gOpt.SSHProxyHost, - gOpt.SSHProxyPort, - gOpt.SSHProxyUser, - p.Password, - p.IdentityFile, - p.IdentityFilePassphrase, - gOpt.SSHProxyTimeout, - gOpt.SSHType, - globalSSHType, - ) - } + tf := task.NewBuilder(m.logger). + RootSSH( + inst.GetHost(), + inst.GetSSHPort(), + user, + s.Password, + s.IdentityFile, + s.IdentityFilePassphrase, + gOpt.SSHTimeout, + gOpt.OptTimeout, + gOpt.SSHProxyHost, + gOpt.SSHProxyPort, + gOpt.SSHProxyUser, + p.Password, + p.IdentityFile, + p.IdentityFilePassphrase, + gOpt.SSHProxyTimeout, + gOpt.SSHType, + globalSSHType, + ) switch fullType { case spec.FullOSType: