summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-12 19:26:37 +0200
committerGitHub <noreply@github.com>2019-10-12 19:26:37 +0200
commita8993bab7861e2181630a022484d3f55f706a460 (patch)
tree9a290c2eac71e5e56318cd0a8c13c3f0e150e869 /pkg
parentcf7e3f3b2fc9e1dd7099f4db0825b83d3a162e3c (diff)
parentf00e1e0223491cdd2d193441924965613810cc87 (diff)
downloadpodman-a8993bab7861e2181630a022484d3f55f706a460.tar.gz
podman-a8993bab7861e2181630a022484d3f55f706a460.tar.bz2
podman-a8993bab7861e2181630a022484d3f55f706a460.zip
Merge pull request #4233 from mheon/fix_cc
Allow giving path to Podman for cleanup command
Diffstat (limited to 'pkg')
-rw-r--r--pkg/spec/createconfig.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go
index 3685450f0..2addfda4b 100644
--- a/pkg/spec/createconfig.go
+++ b/pkg/spec/createconfig.go
@@ -104,7 +104,8 @@ type CreateConfig struct {
NetworkAlias []string //network-alias
PidMode namespaces.PidMode //pid
Pod string //pod
- CgroupMode namespaces.CgroupMode //cgroup
+ PodmanPath string
+ CgroupMode namespaces.CgroupMode //cgroup
PortBindings nat.PortMap
Privileged bool //privileged
Publish []string //publish
@@ -153,7 +154,16 @@ func (c *CreateConfig) createExitCommand(runtime *libpod.Runtime) ([]string, err
return nil, err
}
- cmd, _ := os.Executable()
+ // We need a cleanup process for containers in the current model.
+ // But we can't assume that the caller is Podman - it could be another
+ // user of the API.
+ // As such, provide a way to specify a path to Podman, so we can
+ // still invoke a cleanup process.
+ cmd := c.PodmanPath
+ if cmd == "" {
+ cmd, _ = os.Executable()
+ }
+
command := []string{cmd,
"--root", config.StorageConfig.GraphRoot,
"--runroot", config.StorageConfig.RunRoot,