From 61ea85bddb0ad6c0b83dbeae441d0aacf2fb2588 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 3 Jun 2020 14:53:58 -0400 Subject: 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 --- pkg/domain/infra/abi/containers.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pkg/domain') diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index ad0e957e9..19232eff1 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -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) } -- cgit v1.2.3-54-g00ecf