MCPcopy Index your code
hub / github.com/devspace-sh/devspace / CopyFromReader

Method CopyFromReader

pkg/devspace/kubectl/copy.go:21–33  ·  view source on GitHub ↗

CopyFromReader extracts a tar from the reader to a container path

(ctx context.Context, pod *k8sv1.Pod, container, containerPath string, reader io.Reader)

Source from the content-addressed store, hash-verified

19
20// CopyFromReader extracts a tar from the reader to a container path
21func (client *client) CopyFromReader(ctx context.Context, pod *k8sv1.Pod, container, containerPath string, reader io.Reader) error {
22 _, stderr, err := client.ExecBuffered(ctx, pod, container, []string{"tar", "xzp", "-C", containerPath + "/."}, reader)
23 if err != nil {
24
25 if stderr != nil {
26 return errors.Errorf("error executing tar: %s: %v", string(stderr), err)
27 }
28
29 return errors.Wrap(err, "exec")
30 }
31
32 return nil
33}
34
35// Copy copies the specified folder to the container
36func (client *client) Copy(ctx context.Context, pod *k8sv1.Pod, container, containerPath, localPath string, exclude []string) error {

Callers 1

CopyMethod · 0.95

Calls 2

ExecBufferedMethod · 0.95
ErrorfMethod · 0.45

Tested by

no test coverage detected