summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-08 23:32:34 +0100
committerGitHub <noreply@github.com>2021-03-08 23:32:34 +0100
commit021ff992ffaf52d4b5400a0ccea20844ba456186 (patch)
tree26541e008e858b0a06338fbf5d7913d02f37b6b4 /libpod
parentff46d13ea604381c3a995eae33848cf0c64b3d7a (diff)
parente9db60492261df38cbef04a03c2693547b7e107d (diff)
downloadpodman-021ff992ffaf52d4b5400a0ccea20844ba456186.tar.gz
podman-021ff992ffaf52d4b5400a0ccea20844ba456186.tar.bz2
podman-021ff992ffaf52d4b5400a0ccea20844ba456186.zip
Merge pull request #8172 from rhatdan/storage
[NO TESTS NEEDED] allow the removal of storage images
Diffstat (limited to 'libpod')
-rw-r--r--libpod/runtime_img.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go
index 6e1105b9e..abefca788 100644
--- a/libpod/runtime_img.go
+++ b/libpod/runtime_img.go
@@ -325,6 +325,15 @@ func (r *Runtime) LoadImageFromSingleImageArchive(ctx context.Context, writer io
return "", errors.Wrapf(saveErr, "error pulling image")
}
+// RemoveImageFromStorage goes directly to storage and attempts to remove
+// the specified image. This is dangerous and should only be done if libpod
+// reports that image is not known. This call is useful if you have a corrupted
+// image that was never fully added to the libpod database.
+func (r *Runtime) RemoveImageFromStorage(id string) error {
+ _, err := r.store.DeleteImage(id, true)
+ return err
+}
+
func getImageNames(images []*image.Image) string {
var names string
for i := range images {