summaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
authorMehul Arora <aroram18@mcmaster.ca>2021-06-19 11:27:24 +0530
committerValentin Rothberg <rothberg@redhat.com>2021-07-27 15:32:23 +0200
commit6fe03b25abded53b67a7707abbcd9708042d9151 (patch)
tree91d3f08eee6a7389873d8f22db9dee1393c05a18 /pkg/bindings
parentb6c279be2296ce32fbb36ba39bd948f93be9bede (diff)
downloadpodman-6fe03b25abded53b67a7707abbcd9708042d9151.tar.gz
podman-6fe03b25abded53b67a7707abbcd9708042d9151.tar.bz2
podman-6fe03b25abded53b67a7707abbcd9708042d9151.zip
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 <aroram18@mcmaster.ca> Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/bindings')
-rw-r--r--pkg/bindings/containers/types.go2
-rw-r--r--pkg/bindings/containers/types_copy_options.go16
2 files changed, 18 insertions, 0 deletions
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
+}