CopyFromReader extracts a tar from the reader to a container path
(ctx context.Context, pod *k8sv1.Pod, container, containerPath string, reader io.Reader)
| 19 | |
| 20 | // CopyFromReader extracts a tar from the reader to a container path |
| 21 | func (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 |
| 36 | func (client *client) Copy(ctx context.Context, pod *k8sv1.Pod, container, containerPath, localPath string, exclude []string) error { |
no test coverage detected