diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-06-29 19:51:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-29 19:51:53 +0000 |
commit | 2cc3f127f4f419c107c0b92c6f6457f5faad2e1d (patch) | |
tree | e4c3272cd93eb10ea39c9bc4f0f0f72fce2e389f /libpod/runtime_ctr.go | |
parent | d6cdb996bce10eb050e41b2050aaf52d9bfd3bd0 (diff) | |
parent | 3619f0be9514cd7a2cbdddc6cfb8bc8b7a94485d (diff) | |
download | podman-2cc3f127f4f419c107c0b92c6f6457f5faad2e1d.tar.gz podman-2cc3f127f4f419c107c0b92c6f6457f5faad2e1d.tar.bz2 podman-2cc3f127f4f419c107c0b92c6f6457f5faad2e1d.zip |
Merge pull request #14720 from sstosh/rm-option
Fix: Prevent OCI runtime directory remain
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r-- | libpod/runtime_ctr.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index fafec5e12..4d34c6a08 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -715,6 +715,10 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force, remo // Do a quick ping of the database to check if the container // still exists. if ok, _ := r.state.HasContainer(c.ID()); !ok { + // When the container has already been removed, the OCI runtime directory remain. + if err := c.cleanupRuntime(ctx); err != nil { + return errors.Wrapf(err, "error cleaning up container %s from OCI runtime", c.ID()) + } return nil } } |