Skip to content

Commit

Permalink
cluster: fix cannot push to some instance (#2008)
Browse files Browse the repository at this point in the history
  • Loading branch information
nexustar committed Aug 11, 2022
1 parent f693195 commit 3d39595
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cluster/manager/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 3d39595

Please sign in to comment.