Merge pull request #1217 from snir911/fix_hanging_pods

shimv2: Avoid double removing of container from sandbox
This commit is contained in:
Fabiano Fidêncio
2021-01-08 15:00:54 +01:00
committed by GitHub

View File

@@ -17,13 +17,12 @@ import (
func deleteContainer(ctx context.Context, s *service, c *container) error {
if !c.cType.IsSandbox() {
if c.status != task.StatusStopped {
_, err := s.sandbox.StopContainer(c.id, false)
if err != nil {
if _, err := s.sandbox.StopContainer(c.id, false); err != nil && !isNotFound(err) {
return err
}
}
if _, err := s.sandbox.DeleteContainer(c.id); err != nil {
if _, err := s.sandbox.DeleteContainer(c.id); err != nil && !isNotFound(err) {
return err
}
}