summaryrefslogtreecommitdiff
path: root/libpod/runtime_img.go
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2019-10-14 13:49:06 -0400
committerNalin Dahyabhai <nalin@redhat.com>2019-10-14 13:49:06 -0400
commit17a7596af4f8e2898bd11945a5b3c085b882b021 (patch)
tree49bd3ac19c98fd1f018b7a12e738a0097f7cd0ce /libpod/runtime_img.go
parent3e45d0730b4a17a91912eb161de30cb88e76bb33 (diff)
downloadpodman-17a7596af4f8e2898bd11945a5b3c085b882b021.tar.gz
podman-17a7596af4f8e2898bd11945a5b3c085b882b021.tar.bz2
podman-17a7596af4f8e2898bd11945a5b3c085b882b021.zip
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 <nalin@redhat.com>
Diffstat (limited to 'libpod/runtime_img.go')
-rw-r--r--libpod/runtime_img.go2
1 files changed, 1 insertions, 1 deletions
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 {