Skip to content

Commit 83437ef

Browse files
committed
Fixes containerd-shim-runhcs Delete on exec id
Signed-off-by: Justin Terry (VM) <[email protected]>
1 parent 84aa0bf commit 83437ef

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

runtime/v2/runhcs/service.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -486,13 +486,15 @@ func (s *service) Delete(ctx context.Context, r *taskAPI.DeleteRequest) (*taskAP
486486
return nil, err
487487
}
488488

489-
rhs := newRunhcs(p.bundle)
490-
491-
dopts := &runhcs.DeleteOpts{
492-
Force: true,
493-
}
494-
if err := rhs.Delete(ctx, p.id, dopts); err != nil {
495-
return nil, errors.Wrapf(err, "failed to delete container: %s", p.id)
489+
// This is a container
490+
if p.cid == p.id {
491+
rhs := newRunhcs(p.bundle)
492+
dopts := &runhcs.DeleteOpts{
493+
Force: true,
494+
}
495+
if err := rhs.Delete(ctx, p.id, dopts); err != nil {
496+
return nil, errors.Wrapf(err, "failed to delete container: %s", p.id)
497+
}
496498
}
497499

498500
select {

0 commit comments

Comments
 (0)