shim executor: clean state dir if newProcess() failed

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2017-01-18 09:08:36 +00:00
parent abc1bf4dea
commit d92f60e367

View file

@ -35,6 +35,11 @@ func newProcess(ctx context.Context, o newProcessOpts) (*process, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer func() {
if err != nil {
o.container.StateDir().DeleteProcess(o.ID)
}
}()
exitPipe, controlPipe, err := getControlPipes(procStateDir) exitPipe, controlPipe, err := getControlPipes(procStateDir)
if err != nil { if err != nil {