summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorVikas Goel <vikas.goel@veritas.com>2021-07-16 17:32:41 -0700
committerVikas Goel <vikas.goel@gmail.com>2021-07-20 11:39:32 -0400
commit064bd9d19f30467ffb8f626b6eb13101a12c0ed6 (patch)
tree002ce7f2c1db415e9d5d67438ed11b033e7a45ec /pkg
parent20c9f74c77683730455df4fb5e7722a192b78a92 (diff)
downloadpodman-064bd9d19f30467ffb8f626b6eb13101a12c0ed6.tar.gz
podman-064bd9d19f30467ffb8f626b6eb13101a12c0ed6.tar.bz2
podman-064bd9d19f30467ffb8f626b6eb13101a12c0ed6.zip
Copy the content from the underlying image into the newly created volume.
Fixes: #10262 Signed-off-by: Vikas Goel <vikas.goel@gmail.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/specgen/generate/container_create.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go
index b569f8390..4e3a86ae4 100644
--- a/pkg/specgen/generate/container_create.go
+++ b/pkg/specgen/generate/container_create.go
@@ -153,7 +153,15 @@ func MakeContainer(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGener
if err != nil {
return nil, err
}
- return rt.NewContainer(ctx, runtimeSpec, options...)
+
+ ctr, err := rt.NewContainer(ctx, runtimeSpec, options...)
+ if err != nil {
+ return ctr, err
+ }
+
+ // Copy the content from the underlying image into the newly created
+ // volume if configured to do so.
+ return ctr, rt.PrepareVolumeOnCreateContainer(ctx, ctr)
}
func extractCDIDevices(s *specgen.SpecGenerator) []libpod.CtrCreateOption {