mirror of
https://github.com/containers/podman.git
synced 2025-05-21 00:56:36 +08:00
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>
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user