Fix handling of exit codes

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #183
Approved by: TomSweeneyRedHat
This commit is contained in:
Daniel J Walsh
2018-01-04 08:53:46 -05:00
committed by Atomic Bot
parent 137e5c8ffd
commit b231e3412e
15 changed files with 103 additions and 21 deletions

View File

@ -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 {