summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-12-09 12:18:14 +0100
committerValentin Rothberg <rothberg@redhat.com>2020-12-09 14:05:17 +0100
commita12323884fd576063ba8f5785a3c9c2e48140c7f (patch)
treebbc773511eef8314bca1ef2e76bab68c766fe64b /pkg/domain/infra/abi
parentc2a5011c0d65cfd6c1ab5d6eef9778551ed56860 (diff)
downloadpodman-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/infra/abi')
-rw-r--r--pkg/domain/infra/abi/cp.go6
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()
}