Fix spec generation for task execution

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-05-24 15:40:40 -07:00
parent 923236004a
commit bf9ad0c57f
6 changed files with 128 additions and 36 deletions

View File

@@ -43,9 +43,13 @@ func (c *Container) Spec() (*specs.Spec, error) {
func (c *Container) Delete(ctx context.Context) error {
// TODO: should the client be the one removing resources attached
// to the container at the moment before we have GC?
_, err := c.client.containers().Delete(ctx, &containers.DeleteContainerRequest{
err := c.client.snapshotter().Remove(ctx, c.c.RootFS)
if _, cerr := c.client.containers().Delete(ctx, &containers.DeleteContainerRequest{
ID: c.c.ID,
})
}); err == nil {
err = cerr
}
return err
}