Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
shimv2: cleanup container if not found
Browse files Browse the repository at this point in the history
Shutdown API relies on it being cleaned up in order to proceed.
Otherwise it fails silently and shimv2 process never quits.

This can be triggered by killing the vmm while pod is running.

Fixes: #2345
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
  • Loading branch information
bergwolf committed Dec 11, 2019
1 parent 743309c commit 6eae033
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions containerd-shim-v2/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
)

func deleteContainer(ctx context.Context, s *service, c *container) error {
if !c.cType.IsSandbox() {
status, err := s.sandbox.StatusContainer(c.id)
if err != nil {
return err
}
status, err := s.sandbox.StatusContainer(c.id)
if err != nil && !isNotFound(err) {
return err
}
if !c.cType.IsSandbox() && err == nil {
if status.State.State != types.StateStopped {
_, err = s.sandbox.StopContainer(c.id, false)
if err != nil {
Expand Down

0 comments on commit 6eae033

Please sign in to comment.