diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-03-26 18:11:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-26 18:11:38 +0100 |
commit | 4f38509b6c8366e1093968833e2342b5b65311c5 (patch) | |
tree | 299b90de83112d133e56c85ee4c9d002aa29f056 /pkg/domain/infra/tunnel/images.go | |
parent | 8cccac54979b804d1086ff42654de07dba802a2e (diff) | |
parent | f38a26bfa0621e06ad8401ded3e10d7ea834819e (diff) | |
download | podman-4f38509b6c8366e1093968833e2342b5b65311c5.tar.gz podman-4f38509b6c8366e1093968833e2342b5b65311c5.tar.bz2 podman-4f38509b6c8366e1093968833e2342b5b65311c5.zip |
Merge pull request #5615 from jwhonce/wip/images
V2 podman image rm | podman rmi [IMAGE]
Diffstat (limited to 'pkg/domain/infra/tunnel/images.go')
-rw-r--r-- | pkg/domain/infra/tunnel/images.go | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go index 60df40498..6a241641e 100644 --- a/pkg/domain/infra/tunnel/images.go +++ b/pkg/domain/infra/tunnel/images.go @@ -9,27 +9,30 @@ import ( "github.com/containers/libpod/pkg/domain/utils" ) -func (ir *ImageEngine) Delete(ctx context.Context, nameOrId string, opts entities.ImageDeleteOptions) (*entities.ImageDeleteReport, error) { - results, err := images.Remove(ir.ClientCxt, nameOrId, &opts.Force) - if err != nil { - return nil, err - } +func (ir *ImageEngine) Exists(_ context.Context, nameOrId string) (*entities.BoolReport, error) { + found, err := images.Exists(ir.ClientCxt, nameOrId) + return &entities.BoolReport{Value: found}, err +} - report := entities.ImageDeleteReport{ - Untagged: nil, - Deleted: "", - } +func (ir *ImageEngine) Delete(ctx context.Context, nameOrId []string, opts entities.ImageDeleteOptions) (*entities.ImageDeleteReport, error) { + report := entities.ImageDeleteReport{} - for _, e := range results { - if a, ok := e["Deleted"]; ok { - report.Deleted = a + for _, id := range nameOrId { + results, err := images.Remove(ir.ClientCxt, id, &opts.Force) + if err != nil { + return nil, err } + for _, e := range results { + if a, ok := e["Deleted"]; ok { + report.Deleted = append(report.Deleted, a) + } - if a, ok := e["Untagged"]; ok { - report.Untagged = append(report.Untagged, a) + if a, ok := e["Untagged"]; ok { + report.Untagged = append(report.Untagged, a) + } } } - return &report, err + return &report, nil } func (ir *ImageEngine) List(ctx context.Context, opts entities.ImageListOptions) ([]*entities.ImageSummary, error) { |