summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-20 11:21:47 +0200
committerGitHub <noreply@github.com>2020-08-20 11:21:47 +0200
commit7865db54793fabd5eb17f105292277a3cd74930c (patch)
tree3252be5e651b94ff289d7dfbe1ee7705d3da51ca
parent42690ff89c09b0135428b9e4a3f605aa57dc1189 (diff)
parent1244d9e92ca35fb2281686805335dbf88307328a (diff)
downloadpodman-7865db54793fabd5eb17f105292277a3cd74930c.tar.gz
podman-7865db54793fabd5eb17f105292277a3cd74930c.tar.bz2
podman-7865db54793fabd5eb17f105292277a3cd74930c.zip
Merge pull request #7383 from mheon/unmount_storage_ctrs
Unmount c/storage containers before removing them
-rw-r--r--libpod/runtime_img.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go
index a95cd1d7a..2bc9feb65 100644
--- a/libpod/runtime_img.go
+++ b/libpod/runtime_img.go
@@ -144,6 +144,10 @@ func storageContainers(imageID string, store storage.Store) ([]string, error) {
// Removes the containers passed in the array.
func removeStorageContainers(ctrIDs []string, store storage.Store) error {
for _, ctrID := range ctrIDs {
+ if _, err := store.Unmount(ctrID, true); err != nil {
+ return errors.Wrapf(err, "could not unmount container %q to remove it", ctrID)
+ }
+
if err := store.DeleteContainer(ctrID); err != nil {
return errors.Wrapf(err, "could not remove container %q", ctrID)
}