Fixes containerd-shim-runhcs Delete on exec id

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
This commit is contained in:
Justin Terry (VM) 2018-09-26 13:54:57 -07:00
parent 84aa0bfde6
commit 83437ef646

View File

@ -486,13 +486,15 @@ func (s *service) Delete(ctx context.Context, r *taskAPI.DeleteRequest) (*taskAP
return nil, err
}
rhs := newRunhcs(p.bundle)
dopts := &runhcs.DeleteOpts{
Force: true,
}
if err := rhs.Delete(ctx, p.id, dopts); err != nil {
return nil, errors.Wrapf(err, "failed to delete container: %s", p.id)
// This is a container
if p.cid == p.id {
rhs := newRunhcs(p.bundle)
dopts := &runhcs.DeleteOpts{
Force: true,
}
if err := rhs.Delete(ctx, p.id, dopts); err != nil {
return nil, errors.Wrapf(err, "failed to delete container: %s", p.id)
}
}
select {