diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2020-04-28 09:28:28 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-04-29 07:25:31 +0200 |
commit | 8700c2fd03c29fb898f93e71618d91e2470236f6 (patch) | |
tree | 3c1b0184ac55146bfc06e5f77868f47cb70d73fe /pkg/domain/infra/tunnel | |
parent | bf4efc1953467907ae7d75d5f3ef3cd41505ee24 (diff) | |
download | podman-8700c2fd03c29fb898f93e71618d91e2470236f6.tar.gz podman-8700c2fd03c29fb898f93e71618d91e2470236f6.tar.bz2 podman-8700c2fd03c29fb898f93e71618d91e2470236f6.zip |
enable inspect tests
A surprisingly big change. A core problem was that `podman inspect`
allows for passing containers AND images with the default `--type=all`.
This only worked partially as the data was processed in isolation which
caused various issues (e.g., two separate outputs instead of one) but it
also caused issues regarding error handling.
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/domain/infra/tunnel')
-rw-r--r-- | pkg/domain/infra/tunnel/images.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go index 66e4e6e3f..dcc5fc3e7 100644 --- a/pkg/domain/infra/tunnel/images.go +++ b/pkg/domain/infra/tunnel/images.go @@ -143,16 +143,16 @@ func (ir *ImageEngine) Untag(ctx context.Context, nameOrId string, tags []string return nil } -func (ir *ImageEngine) Inspect(_ context.Context, names []string, opts entities.InspectOptions) (*entities.ImageInspectReport, error) { - report := entities.ImageInspectReport{} - for _, id := range names { - r, err := images.GetImage(ir.ClientCxt, id, &opts.Size) +func (ir *ImageEngine) Inspect(ctx context.Context, namesOrIDs []string, opts entities.InspectOptions) ([]*entities.ImageInspectReport, error) { + reports := []*entities.ImageInspectReport{} + for _, i := range namesOrIDs { + r, err := images.GetImage(ir.ClientCxt, i, &opts.Size) if err != nil { - report.Errors[id] = err + return nil, err } - report.Images = append(report.Images, r) + reports = append(reports, r) } - return &report, nil + return reports, nil } func (ir *ImageEngine) Load(ctx context.Context, opts entities.ImageLoadOptions) (*entities.ImageLoadReport, error) { |