containerd-shim: Don't try to delete container twice

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure
2017-08-14 16:08:09 -07:00
parent eb4abac9f7
commit c23f29ebce
2 changed files with 76 additions and 51 deletions

View File

@@ -185,6 +185,7 @@ func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts
}
// after the task is created, add it to the monitor
if err = r.monitor.Monitor(t); err != nil {
r.tasks.Delete(ctx, t)
return nil, err
}
return t, nil