summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2019-01-10 10:43:32 -0500
committerGitHub <noreply@github.com>2019-01-10 10:43:32 -0500
commitac426bada215b02b586cdcf0beea7ddd0099c575 (patch)
tree270bb88c2d7ba65f5e762ca00d868cf56bc68443
parent69c3e329411318f51381649e77df70bbfc3e4b2e (diff)
parent7ba38b375fc3ce4bb34dd86ca763c0359242497b (diff)
downloadpodman-ac426bada215b02b586cdcf0beea7ddd0099c575.tar.gz
podman-ac426bada215b02b586cdcf0beea7ddd0099c575.tar.bz2
podman-ac426bada215b02b586cdcf0beea7ddd0099c575.zip
Merge pull request #2121 from giuseppe/always-cleanup-rootless-containers
createconfig: always cleanup a rootless container
-rw-r--r--pkg/spec/createconfig.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go
index ffc98e307..87fce7e2e 100644
--- a/pkg/spec/createconfig.go
+++ b/pkg/spec/createconfig.go
@@ -518,7 +518,9 @@ func (c *CreateConfig) GetContainerCreateOptions(runtime *libpod.Runtime) ([]lib
if c.CgroupParent != "" {
options = append(options, libpod.WithCgroupParent(c.CgroupParent))
}
- if c.Detach {
+ // For a rootless container always cleanup the storage/network as they
+ // run in a different namespace thus not reusable when we restart.
+ if c.Detach || rootless.IsRootless() {
options = append(options, libpod.WithExitCommand(c.createExitCommand()))
}