aboutsummaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index c14fe95b0..f35cce772 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -666,6 +666,15 @@ func (c *Container) Cleanup(ctx context.Context) error {
defer c.lock.Unlock()
if err := c.syncContainer(); err != nil {
+ switch errors.Cause(err) {
+ // When the container has already been removed, the OCI runtime directory remain.
+ case define.ErrNoSuchCtr, define.ErrCtrRemoved:
+ if err := c.cleanupRuntime(ctx); err != nil {
+ return errors.Wrapf(err, "error cleaning up container %s from OCI runtime", c.ID())
+ }
+ default:
+ logrus.Errorf("Syncing container %s status: %v", c.ID(), err)
+ }
return err
}
}