mirror of
https://github.com/containers/podman.git
synced 2025-06-20 00:51:16 +08:00
When stopping containers locally, ensure cleanup runs
The cleanup process was already running and ensuring that mounts and networking configuration was cleaned up on container stop, but this was async from the actual `podman stop` command which breaks some expectations - the container is still mounted at the end of `podman stop` and will be cleaned up soon, but not immediately. Fortunately, it's a trivial change to resolve this. Fixes #5747 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
@ -179,6 +179,12 @@ func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []strin
|
||||
report.Err = err
|
||||
reports = append(reports, &report)
|
||||
continue
|
||||
} else if err := con.Cleanup(ctx); err != nil {
|
||||
// Only if no error, proceed to cleanup to ensure all
|
||||
// mounts are removed before we exit.
|
||||
report.Err = err
|
||||
reports = append(reports, &report)
|
||||
continue
|
||||
}
|
||||
reports = append(reports, &report)
|
||||
}
|
||||
|
Reference in New Issue
Block a user