Skip to content
Permalink
Browse files

kinder: fix typo in manager/manage.go

  • Loading branch information
neolit123 committed Nov 7, 2019
1 parent 579f104 commit 6c8f5b87b57692ba354060413b1d66a4a57a9b30
Showing with 6 additions and 6 deletions.
  1. +6 −6 kinder/pkg/cluster/manager/manage.go
@@ -122,12 +122,12 @@ func (c *ClusterManager) CopyFile(source, target string) error {
return err
}

teargetNodes, targetPath, err := c.ResolveNodesPath(target)
targetNodes, targetPath, err := c.ResolveNodesPath(target)
if err != nil {
return err
}

if sourceNodes == nil && teargetNodes == nil {
if sourceNodes == nil && targetNodes == nil {
return errors.Errorf("at least one between source and target must be a node/nodes in the cluster")
}

@@ -142,24 +142,24 @@ func (c *ClusterManager) CopyFile(source, target string) error {
}
}

if teargetNodes != nil && len(teargetNodes) == 0 {
if targetNodes != nil && len(targetNodes) == 0 {
return errors.Errorf("no target node matches given criteria")
}

if sourceNodes != nil && teargetNodes != nil {
if sourceNodes != nil && targetNodes != nil {
// create tmp folder
// cp locally
return errors.Errorf("copy between nodes not implemented yet!")
}

if teargetNodes == nil {
if targetNodes == nil {
fmt.Printf("Copying from %s ...\n", sourceNodes[0].Name())
if err := sourceNodes[0].CopyFrom(sourcePath, targetPath); err != nil {
return err
}
}

for _, n := range teargetNodes {
for _, n := range targetNodes {
fmt.Printf("Copying to %s ...\n", n.Name())
if err := n.CopyTo(sourcePath, targetPath); err != nil {
return err

0 comments on commit 6c8f5b8

Please sign in to comment.
You can’t perform that action at this time.