summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/images.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-29 17:04:05 +0100
committerGitHub <noreply@github.com>2020-10-29 17:04:05 +0100
commit74850052067c7a9c76c961fa06205388e9684be3 (patch)
tree2ce103c68a52b1f8e807fbae206ed10bba1926ef /pkg/domain/infra/abi/images.go
parentb6aa9c10770de3d500d5f1b3f0e31bc8e17a855b (diff)
parent99d3e2e9d72f93399a2d3a5974eea0df6362153f (diff)
downloadpodman-74850052067c7a9c76c961fa06205388e9684be3.tar.gz
podman-74850052067c7a9c76c961fa06205388e9684be3.tar.bz2
podman-74850052067c7a9c76c961fa06205388e9684be3.zip
Merge pull request #8178 from rhatdan/exists
NewFromLocal can return multiple images
Diffstat (limited to 'pkg/domain/infra/abi/images.go')
-rw-r--r--pkg/domain/infra/abi/images.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index 25335cf11..ef0e15264 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -39,8 +39,14 @@ const SignatureStoreDir = "/var/lib/containers/sigstore"
func (ir *ImageEngine) Exists(_ context.Context, nameOrID string) (*entities.BoolReport, error) {
_, err := ir.Libpod.ImageRuntime().NewFromLocal(nameOrID)
- if err != nil && errors.Cause(err) != define.ErrNoSuchImage {
- return nil, err
+ if err != nil {
+ if errors.Cause(err) == define.ErrMultipleImages {
+ return &entities.BoolReport{Value: true}, nil
+ } else {
+ if errors.Cause(err) != define.ErrNoSuchImage {
+ return nil, err
+ }
+ }
}
return &entities.BoolReport{Value: err == nil}, nil
}