summaryrefslogtreecommitdiff
path: root/libpod/container.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-01-04 08:53:46 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-04 21:05:10 +0000
commitb231e3412e7d37d9680229e3782e28161792c7f8 (patch)
treeda0d214d45bbb13b3254dfe450b73ddc24e44351 /libpod/container.go
parent137e5c8ffd5e1d7abe47398d909c9611f19bfcbb (diff)
downloadpodman-b231e3412e7d37d9680229e3782e28161792c7f8.tar.gz
podman-b231e3412e7d37d9680229e3782e28161792c7f8.tar.bz2
podman-b231e3412e7d37d9680229e3782e28161792c7f8.zip
Fix handling of exit codes
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #183 Approved by: TomSweeneyRedHat
Diffstat (limited to 'libpod/container.go')
-rw-r--r--libpod/container.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/libpod/container.go b/libpod/container.go
index 2b70afec2..efb4873b0 100644
--- a/libpod/container.go
+++ b/libpod/container.go
@@ -558,6 +558,13 @@ func (c *Container) Init() (err error) {
if err := c.mountStorage(); err != nil {
return err
}
+ defer func() {
+ if err != nil {
+ if err2 := c.cleanupStorage(); err2 != nil {
+ logrus.Errorf("Error cleaning up storage for container %s: %v", c.ID(), err2)
+ }
+ }
+ }()
// Make a network namespace for the container
if c.config.CreateNetNS && c.state.NetNS == nil {