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
commit 7865db5479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

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