From 17a7596af4f8e2898bd11945a5b3c085b882b021 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Mon, 14 Oct 2019 13:49:06 -0400 Subject: Unwrap errors before comparing them Unwrap errors before directly comparing them with errors defined by the storage and image libraries. Signed-off-by: Nalin Dahyabhai --- libpod/runtime_img.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpod/runtime_img.go') diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go index 8cc501629..35c0cdfb9 100644 --- a/libpod/runtime_img.go +++ b/libpod/runtime_img.go @@ -69,7 +69,7 @@ func (r *Runtime) RemoveImage(ctx context.Context, img *image.Image, force bool) // the image. we figure out which repotag the user is trying to refer // to and untag it. repoName, err := img.MatchRepoTag(img.InputName) - if hasChildren && err == image.ErrRepoTagNotFound { + if hasChildren && errors.Cause(err) == image.ErrRepoTagNotFound { return "", errors.Errorf("unable to delete %q (cannot be forced) - image has dependent child images", img.ID()) } if err != nil { -- cgit v1.2.3-54-g00ecf