mirror of
https://github.com/containers/podman.git
synced 2025-05-23 10:07:33 +08:00
Merge pull request #7383 from mheon/unmount_storage_ctrs
Unmount c/storage containers before removing them
This commit is contained in:
@ -144,6 +144,10 @@ func storageContainers(imageID string, store storage.Store) ([]string, error) {
|
|||||||
// Removes the containers passed in the array.
|
// Removes the containers passed in the array.
|
||||||
func removeStorageContainers(ctrIDs []string, store storage.Store) error {
|
func removeStorageContainers(ctrIDs []string, store storage.Store) error {
|
||||||
for _, ctrID := range ctrIDs {
|
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 {
|
if err := store.DeleteContainer(ctrID); err != nil {
|
||||||
return errors.Wrapf(err, "could not remove container %q", ctrID)
|
return errors.Wrapf(err, "could not remove container %q", ctrID)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user