summaryrefslogtreecommitdiff
path: root/pkg/specgen
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-07-21 05:52:09 -0400
committerGitHub <noreply@github.com>2021-07-21 05:52:09 -0400
commita7dcae5abc81d4c4809aebca39b2ac9db1bca3d7 (patch)
tree96d14b43495b50429bca453d0788b4f942343703 /pkg/specgen
parent389c9b8dca942fb4977823dd504d3d351cb92acd (diff)
parent064bd9d19f30467ffb8f626b6eb13101a12c0ed6 (diff)
downloadpodman-a7dcae5abc81d4c4809aebca39b2ac9db1bca3d7.tar.gz
podman-a7dcae5abc81d4c4809aebca39b2ac9db1bca3d7.tar.bz2
podman-a7dcae5abc81d4c4809aebca39b2ac9db1bca3d7.zip
Merge pull request #10970 from vikas-goel/prepare-volume
Copy the content from the underlying image into the newly created volume
Diffstat (limited to 'pkg/specgen')
-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 {