summaryrefslogtreecommitdiff
path: root/libpod/runtime_img.go
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2021-04-14 13:35:43 -0400
committerNalin Dahyabhai <nalin@redhat.com>2021-04-20 15:44:39 -0400
commitfd9dd7065d440f9d44d51ddccbda20c01ccdc1aa (patch)
tree70ff833a098443b7993195c41b67b3741c7b6876 /libpod/runtime_img.go
parent2a32fc3e403e4b70fb68fda564cbdf33b7dd5326 (diff)
downloadpodman-fd9dd7065d440f9d44d51ddccbda20c01ccdc1aa.tar.gz
podman-fd9dd7065d440f9d44d51ddccbda20c01ccdc1aa.tar.bz2
podman-fd9dd7065d440f9d44d51ddccbda20c01ccdc1aa.zip
rmi: don't break when the image is missing a manifest
In libpod/image.Image.Remove(), if the attempt to find the image's parent fails for any reason, log a warning and proceed as though it didn't have one instead of failing, which would leave us unable to remove the image without resetting everything. In libpod/Runtime.RemoveImage(), if we can't determine if an image has children, log a warning, and assume that it doesn't have any instead of failing, which would leave us unable to remove the image without resetting everything. In pkg/domain/infra/abi.ImageEngine.Remove(), when attempting to remove all images, if we encounter an error checking if a given image has children, log a warning, and assume that it doesn't have any instead of failing, which would leave us unable to remove the image without resetting everything. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Diffstat (limited to 'libpod/runtime_img.go')
-rw-r--r--libpod/runtime_img.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go
index 3588467a5..2b101c01f 100644
--- a/libpod/runtime_img.go
+++ b/libpod/runtime_img.go
@@ -66,7 +66,8 @@ func (r *Runtime) RemoveImage(ctx context.Context, img *image.Image, force bool)
hasChildren, err := img.IsParent(ctx)
if err != nil {
- return nil, err
+ logrus.Warnf("error determining if an image is a parent: %v, ignoring the error", err)
+ hasChildren = false
}
if (len(img.Names()) > 1 && !img.InputIsID()) || hasChildren {