summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/containers.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2020-06-03 14:53:58 -0400
committerMatthew Heon <matthew.heon@pm.me>2020-06-03 15:16:24 -0400
commit61ea85bddb0ad6c0b83dbeae441d0aacf2fb2588 (patch)
treee5ba8f7c8cd55be3ff8db5b10c960a9474906440 /pkg/domain/infra/abi/containers.go
parentbba0a8be1a715fb0903ffc69abd5700a624d47e4 (diff)
downloadpodman-61ea85bddb0ad6c0b83dbeae441d0aacf2fb2588.tar.gz
podman-61ea85bddb0ad6c0b83dbeae441d0aacf2fb2588.tar.bz2
podman-61ea85bddb0ad6c0b83dbeae441d0aacf2fb2588.zip
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>
Diffstat (limited to 'pkg/domain/infra/abi/containers.go')
-rw-r--r--pkg/domain/infra/abi/containers.go6
1 files changed, 6 insertions, 0 deletions
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)
}