summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/images.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-04-09 16:11:38 -0500
committerBrent Baude <bbaude@redhat.com>2020-04-09 16:59:33 -0500
commit7d0e0a7129e18ca7295cf4b0fbec22d0df78d3dd (patch)
tree29102563982befd9a07106ab93a8ebab43b983f4 /pkg/domain/infra/abi/images.go
parent3a4bd395164c97bf4b8b1fcb97f2475ca188866e (diff)
downloadpodman-7d0e0a7129e18ca7295cf4b0fbec22d0df78d3dd.tar.gz
podman-7d0e0a7129e18ca7295cf4b0fbec22d0df78d3dd.tar.bz2
podman-7d0e0a7129e18ca7295cf4b0fbec22d0df78d3dd.zip
v2podman container cleanup
add the ability to clean up after a container has attempted to run. this is also important for podman run --rm --rmi. also included are fixes and tweaks to various code bits to correct regressions on output. Signed-off-by: Brent Baude <bbaude@redhat.com>
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) {