From 7629203bd019aaba02e81742e60099e79f38d23f Mon Sep 17 00:00:00 2001 From: nexustar Date: Fri, 5 Aug 2022 11:28:33 +0800 Subject: [PATCH] cluster: fix cannot push to some instance --- pkg/cluster/manager/transfer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/manager/transfer.go b/pkg/cluster/manager/transfer.go index 2e316e7157..e61848b1fe 100644 --- a/pkg/cluster/manager/transfer.go +++ b/pkg/cluster/manager/transfer.go @@ -63,7 +63,7 @@ func (m *Manager) Transfer(name string, opt TransferOptions, gOpt operator.Optio uniqueHosts := map[string]set.StringSet{} // host-sshPort -> {remote-path} topo.IterInstance(func(inst spec.Instance) { - key := fmt.Sprintf("%s-%d", inst.GetHost(), inst.GetSSHPort()) + key := fmt.Sprintf("%d-%s", inst.GetSSHPort(), inst.GetHost()) if _, found := uniqueHosts[key]; !found { if len(gOpt.Roles) > 0 && !filterRoles.Exist(inst.Role()) { return @@ -91,7 +91,7 @@ func (m *Manager) Transfer(name string, opt TransferOptions, gOpt operator.Optio srcPath := opt.Local for hostKey, i := range uniqueHosts { - host := strings.Split(hostKey, "-")[0] + host := hostKey[len(strings.Split(hostKey, "-")[0])+1:] for _, p := range i.Slice() { t := task.NewBuilder(m.logger) if opt.Pull {