From a12323884fd576063ba8f5785a3c9c2e48140c7f Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 9 Dec 2020 12:18:14 +0100 Subject: 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 --- pkg/domain/infra/abi/cp.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg/domain') 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() } -- cgit v1.2.3-54-g00ecf