Merge pull request #583 from crosbymichael/delete

Make sure container is destroyed on error
This commit is contained in:
Mrunal Patel 2016-02-23 13:30:19 +05:30
commit 2c3115481e
1 changed files with 6 additions and 1 deletions

View File

@ -111,5 +111,10 @@ func startContainer(context *cli.Context, spec *specs.LinuxSpec) (int, error) {
listenFDs = activation.Files(false)
}
return runProcess(container, &spec.Process, listenFDs, context.String("console"), context.String("pid-file"), detach)
status, err := runProcess(container, &spec.Process, listenFDs, context.String("console"), context.String("pid-file"), detach)
if err != nil {
destroy(container)
return -1, err
}
return status, nil
}