mirror of
https://github.com/containers/podman.git
synced 2025-10-14 01:35:29 +08:00
podman rm: handle case where conmon was killed
When conmon was killed podman rm -f currently fails but running it again then works which doesn't really makes sense. We should properly remove the contianer even if conmon is dead. In fact the code already handles ErrConmonDead as stop error when we remove the container but this error was never thrown anywhere. To fix this throw ErrConmonDead instead of ErrInternal because that is not an intenral error if something else killed conmon. With this we can correctly cleanup and remove the container. The fact that this works on the first try is important for quadlet units as they only run the ExecStopPost= command once to remove it. Fixes: #26640 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -1544,7 +1544,7 @@ func (c *Container) waitForConmonToExitAndSave() error {
|
||||
logrus.Errorf("Error cleaning up container %s after Conmon exited prematurely: %v", c.ID(), err)
|
||||
}
|
||||
|
||||
return fmt.Errorf("container %s conmon exited prematurely, exit code could not be retrieved: %w", c.ID(), define.ErrInternal)
|
||||
return fmt.Errorf("container %s conmon exited prematurely, exit code could not be retrieved: %w", c.ID(), define.ErrConmonDead)
|
||||
}
|
||||
|
||||
return c.save()
|
||||
|
Reference in New Issue
Block a user