aboutsummaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/pod_create.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-24 18:35:59 -0400
committerGitHub <noreply@github.com>2020-08-24 18:35:59 -0400
commit024f47068a894907ee47b1b90c86090a00586940 (patch)
tree4528b3566c3162ca2892b8c3d752d3957161e3d5 /pkg/specgen/generate/pod_create.go
parentc78c6b44ce63430218e141415a10b2010d42f883 (diff)
parent13d5b2d661478005a0b7eec5563d13580b6cd3f8 (diff)
downloadpodman-024f47068a894907ee47b1b90c86090a00586940.tar.gz
podman-024f47068a894907ee47b1b90c86090a00586940.tar.bz2
podman-024f47068a894907ee47b1b90c86090a00586940.zip
Merge pull request #7402 from mheon/last_pr_before_205_really_this_time
Final v2.0.5 backports
Diffstat (limited to 'pkg/specgen/generate/pod_create.go')
-rw-r--r--pkg/specgen/generate/pod_create.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/pkg/specgen/generate/pod_create.go b/pkg/specgen/generate/pod_create.go
index 4fe1b6435..09972da4a 100644
--- a/pkg/specgen/generate/pod_create.go
+++ b/pkg/specgen/generate/pod_create.go
@@ -13,14 +13,14 @@ func MakePod(p *specgen.PodSpecGenerator, rt *libpod.Runtime) (*libpod.Pod, erro
if err := p.Validate(); err != nil {
return nil, err
}
- options, err := createPodOptions(p)
+ options, err := createPodOptions(p, rt)
if err != nil {
return nil, err
}
return rt.NewPod(context.Background(), options...)
}
-func createPodOptions(p *specgen.PodSpecGenerator) ([]libpod.PodCreateOption, error) {
+func createPodOptions(p *specgen.PodSpecGenerator, rt *libpod.Runtime) ([]libpod.PodCreateOption, error) {
var (
options []libpod.PodCreateOption
)
@@ -31,6 +31,18 @@ func createPodOptions(p *specgen.PodSpecGenerator) ([]libpod.PodCreateOption, er
return nil, err
}
options = append(options, nsOptions...)
+
+ // Make our exit command
+ storageConfig := rt.StorageConfig()
+ runtimeConfig, err := rt.GetConfig()
+ if err != nil {
+ return nil, err
+ }
+ exitCommand, err := CreateExitCommandArgs(storageConfig, runtimeConfig, logrus.IsLevelEnabled(logrus.DebugLevel), false, false)
+ if err != nil {
+ return nil, errors.Wrapf(err, "error creating infra container exit command")
+ }
+ options = append(options, libpod.WithPodInfraExitCommand(exitCommand))
}
if len(p.CgroupParent) > 0 {
options = append(options, libpod.WithPodCgroupParent(p.CgroupParent))