From 83437ef646eb61fbe3788d0e66004b904c0272fd Mon Sep 17 00:00:00 2001 From: "Justin Terry (VM)" Date: Wed, 26 Sep 2018 13:54:57 -0700 Subject: [PATCH] Fixes containerd-shim-runhcs Delete on exec id Signed-off-by: Justin Terry (VM) --- runtime/v2/runhcs/service.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/runtime/v2/runhcs/service.go b/runtime/v2/runhcs/service.go index 895bcead9..7d302b477 100644 --- a/runtime/v2/runhcs/service.go +++ b/runtime/v2/runhcs/service.go @@ -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 {