diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-20 11:21:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-20 11:21:47 +0200 |
commit | 7865db54793fabd5eb17f105292277a3cd74930c (patch) | |
tree | 3252be5e651b94ff289d7dfbe1ee7705d3da51ca /libpod | |
parent | 42690ff89c09b0135428b9e4a3f605aa57dc1189 (diff) | |
parent | 1244d9e92ca35fb2281686805335dbf88307328a (diff) | |
download | podman-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
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/runtime_img.go | 4 |
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) } |