aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Khachayants <tyler92@inbox.ru>2022-09-06 16:56:57 +0300
committerMikhail Khachayants <tyler92@inbox.ru>2022-09-06 20:41:10 +0300
commit9585147e1e281ffa35f94d2fecdf8ad6f76faaf7 (patch)
tree7246434b9bef05853e7cd77fab2f687730a444ac
parent46e9178ef64ca1e7513251770ccab982eb5f9801 (diff)
downloadpodman-9585147e1e281ffa35f94d2fecdf8ad6f76faaf7.tar.gz
podman-9585147e1e281ffa35f94d2fecdf8ad6f76faaf7.tar.bz2
podman-9585147e1e281ffa35f94d2fecdf8ad6f76faaf7.zip
fix Pod removal after OS hard shutdown
In case of a hard OS shutdown, containers may have a "removing" state after a reboot, and an attempt to remove Pods with such containers is unsuccessful: error freeing lock for container ...: no such file or directory [NO NEW TESTS NEEDED] Signed-off-by: Mikhail Khachayants <tyler92@inbox.ru>
-rw-r--r--libpod/runtime_ctr.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index 1e1b7dad5..fb4f80aa6 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -798,7 +798,7 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force, remo
// Deallocate the container's lock
if err := c.lock.Free(); err != nil {
- if cleanupErr == nil {
+ if cleanupErr == nil && !os.IsNotExist(err) {
cleanupErr = fmt.Errorf("error freeing lock for container %s: %w", c.ID(), err)
} else {
logrus.Errorf("Free container lock: %v", err)