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-04-10 14:11:30 +0200
committerGitHub <noreply@github.com>2020-04-10 14:11:30 +0200
commit2a8db9d17c5dd762366fe7c90304e76337e5d668 (patch)
tree68c8f58631d70cdfff949d3a171581b236525a8e /pkg/domain/infra/abi/images.go
parent838b5e1e387f6f6bdae06f053684832f77ca8796 (diff)
parent7d0e0a7129e18ca7295cf4b0fbec22d0df78d3dd (diff)
downloadpodman-2a8db9d17c5dd762366fe7c90304e76337e5d668.tar.gz
podman-2a8db9d17c5dd762366fe7c90304e76337e5d668.tar.bz2
podman-2a8db9d17c5dd762366fe7c90304e76337e5d668.zip
Merge pull request #5782 from baude/v2containercleanup
v2podman container cleanup
Diffstat (limited to 'pkg/domain/infra/abi/images.go')
-rw-r--r--pkg/domain/infra/abi/images.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index 2edef2723..24ee596be 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -15,6 +15,7 @@ import (
"github.com/containers/image/v5/manifest"
"github.com/containers/image/v5/transports/alltransports"
"github.com/containers/image/v5/types"
+ "github.com/containers/libpod/libpod/define"
"github.com/containers/libpod/libpod/image"
libpodImage "github.com/containers/libpod/libpod/image"
"github.com/containers/libpod/pkg/domain/entities"
@@ -27,10 +28,11 @@ import (
)
func (ir *ImageEngine) Exists(_ context.Context, nameOrId string) (*entities.BoolReport, error) {
- if _, err := ir.Libpod.ImageRuntime().NewFromLocal(nameOrId); err != nil {
- return &entities.BoolReport{}, nil
+ _, err := ir.Libpod.ImageRuntime().NewFromLocal(nameOrId)
+ if err != nil && errors.Cause(err) != define.ErrNoSuchImage {
+ return nil, err
}
- return &entities.BoolReport{Value: true}, nil
+ return &entities.BoolReport{Value: err == nil}, nil
}
func (ir *ImageEngine) Delete(ctx context.Context, nameOrId []string, opts entities.ImageDeleteOptions) (*entities.ImageDeleteReport, error) {