Skip to content

Commit

Permalink
Merge pull request #7383 from mheon/unmount_storage_ctrs
Browse files Browse the repository at this point in the history
Unmount c/storage containers before removing them
  • Loading branch information
openshift-merge-robot authored Aug 20, 2020
2 parents 42690ff + 1244d9e commit 7865db5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libpod/runtime_img.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 7865db5

Please sign in to comment.