From 6fe03b25abded53b67a7707abbcd9708042d9151 Mon Sep 17 00:00:00 2001 From: Mehul Arora Date: Sat, 19 Jun 2021 11:27:24 +0530 Subject: support container to container copy Implement container to container copy. Previously data could only be copied from/to the host. Fixes: #7370 Co-authored-by: Mehul Arora Signed-off-by: Valentin Rothberg --- pkg/bindings/containers/types.go | 2 ++ pkg/bindings/containers/types_copy_options.go | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) (limited to 'pkg/bindings') diff --git a/pkg/bindings/containers/types.go b/pkg/bindings/containers/types.go index 1058c7a48..39492077b 100644 --- a/pkg/bindings/containers/types.go +++ b/pkg/bindings/containers/types.go @@ -263,4 +263,6 @@ type CopyOptions struct { // If used with CopyFromArchive and set to true it will change ownership of files from the source tar archive // to the primary uid/gid of the target container. Chown *bool `schema:"copyUIDGID"` + // Map to translate path names. + Rename map[string]string } diff --git a/pkg/bindings/containers/types_copy_options.go b/pkg/bindings/containers/types_copy_options.go index 12ad085fd..0624b450e 100644 --- a/pkg/bindings/containers/types_copy_options.go +++ b/pkg/bindings/containers/types_copy_options.go @@ -35,3 +35,19 @@ func (o *CopyOptions) GetChown() bool { } return *o.Chown } + +// WithRename +func (o *CopyOptions) WithRename(value map[string]string) *CopyOptions { + v := value + o.Rename = v + return o +} + +// GetRename +func (o *CopyOptions) GetRename() map[string]string { + var rename map[string]string + if o.Rename == nil { + return rename + } + return o.Rename +} -- cgit v1.2.3-54-g00ecf