Skip to content

Commit

Permalink
Move copyfiles function to client-go
Browse files Browse the repository at this point in the history
Resolves #443

This PR will remove dependency of oc binary for `copyfiles` function which copies file to component while `odo push`
  • Loading branch information
surajnarwade committed Jun 7, 2018
1 parent 3b5940e commit f203129
Show file tree
Hide file tree
Showing 3 changed files with 320 additions and 237 deletions.
8 changes: 1 addition & 7 deletions pkg/component/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,11 @@ func PushLocal(client *occlient.Client, componentName string, applicationName st
if err != nil {
return errors.Wrapf(err, "error while waiting for pod %s", podSelector)
}
var syncOutput string
if !asFile {
syncOutput, err = client.RsyncPath(path, pod.Name, targetPath)
} else {
syncOutput, err = client.CopyFile(path, pod.Name, targetPath)

}
err = client.CopyFile(asFile, path, pod.Name, targetPath)
if err != nil {
return errors.Wrap(err, "unable push files to pod")
}
fmt.Fprintf(out, syncOutput)
fmt.Fprintf(out, "Please wait, building component....\n")

// use pipes to write output from ExecCMDInContainer in yellow to 'out' io.Writer
Expand Down

0 comments on commit f203129

Please sign in to comment.