Merge pull request #7383 from mheon/unmount_storage_ctrs

Unmount c/storage containers before removing them
This commit is contained in:
OpenShift Merge Robot
2020-08-20 11:21:47 +02:00
committed by GitHub

View File

@ -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)
}