Skip to content

Commit

Permalink
cluster: use correct path order in args
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroProfundis committed Jan 7, 2021
1 parent a666f28 commit 69a5f6d
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions pkg/cluster/manager/transfer.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 PingCAP, Inc.
// Copyright 2021 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -68,7 +68,7 @@ func (m *Manager) Transfer(name string, opt TransferOptions, gOpt operator.Optio
instPath := opt.Remote
paths, err := renderInstanceSpec(instPath, inst)
if err != nil {
return
return // skip
}
pathSet := set.NewStringSet(paths...)
if _, ok := uniqueHosts[inst.GetHost()]; ok {
Expand All @@ -82,11 +82,17 @@ func (m *Manager) Transfer(name string, opt TransferOptions, gOpt operator.Optio
}
})

for host := range uniqueHosts {
shellTasks = append(shellTasks,
task.NewBuilder().
CopyFile(opt.Local, opt.Remote, host, opt.Pull).
Build())
srcPath := opt.Local
for host, i := range uniqueHosts {
for _, p := range i.remotePaths.Slice() {
t := task.NewBuilder()
if opt.Pull {
t.CopyFile(p, srcPath, host, opt.Pull)
} else {
t.CopyFile(srcPath, p, host, opt.Pull)
}
shellTasks = append(shellTasks, t.Build())
}
}

t := m.sshTaskBuilder(name, topo, base.User, gOpt).
Expand Down

0 comments on commit 69a5f6d

Please sign in to comment.