diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2020-12-09 12:18:14 +0100 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-12-09 14:05:17 +0100 |
commit | a12323884fd576063ba8f5785a3c9c2e48140c7f (patch) | |
tree | bbc773511eef8314bca1ef2e76bab68c766fe64b /pkg/domain | |
parent | c2a5011c0d65cfd6c1ab5d6eef9778551ed56860 (diff) | |
download | podman-a12323884fd576063ba8f5785a3c9c2e48140c7f.tar.gz podman-a12323884fd576063ba8f5785a3c9c2e48140c7f.tar.bz2 podman-a12323884fd576063ba8f5785a3c9c2e48140c7f.zip |
pkg/copy: introduce a Copier
Introduce a `Copier` object to separate the copy-rule enforcement from
copying. That allows for a better error reporting of the REST API.
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/infra/abi/cp.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/cp.go b/pkg/domain/infra/abi/cp.go index 7cc3005c1..362053cce 100644 --- a/pkg/domain/infra/abi/cp.go +++ b/pkg/domain/infra/abi/cp.go @@ -62,5 +62,9 @@ func (ic *ContainerEngine) ContainerCp(ctx context.Context, source, dest string, } // Copy from the host to the container. - return copy.Copy(&sourceItem, &destinationItem, options.Extract) + copier, err := copy.GetCopier(&sourceItem, &destinationItem, options.Extract) + if err != nil { + return err + } + return copier.Copy() } |