diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-06-17 16:27:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-17 16:27:15 +0200 |
commit | 200afe7a942b294401714980502b80a549b92fb1 (patch) | |
tree | ab2eb7f9aa7fdb1a25035651ee2fe530e7742327 /pkg/domain/infra/tunnel/images.go | |
parent | 38391ed25fdb1cc53b70a75ee4fbe7ea0fa782c3 (diff) | |
parent | 6589d75565db2c0546787a01e8381cee15edbdf5 (diff) | |
download | podman-200afe7a942b294401714980502b80a549b92fb1.tar.gz podman-200afe7a942b294401714980502b80a549b92fb1.tar.bz2 podman-200afe7a942b294401714980502b80a549b92fb1.zip |
Merge pull request #6583 from mheon/inspect_ctr_before_img
Fix podman inspect on overlapping/missing objects
Diffstat (limited to 'pkg/domain/infra/tunnel/images.go')
-rw-r--r-- | pkg/domain/infra/tunnel/images.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go index fc7ac0aa8..9ddc5f1a9 100644 --- a/pkg/domain/infra/tunnel/images.go +++ b/pkg/domain/infra/tunnel/images.go @@ -157,16 +157,25 @@ func (ir *ImageEngine) Untag(ctx context.Context, nameOrID string, tags []string return nil } -func (ir *ImageEngine) Inspect(ctx context.Context, namesOrIDs []string, opts entities.InspectOptions) ([]*entities.ImageInspectReport, error) { +func (ir *ImageEngine) Inspect(ctx context.Context, namesOrIDs []string, opts entities.InspectOptions) ([]*entities.ImageInspectReport, []error, error) { reports := []*entities.ImageInspectReport{} + errs := []error{} for _, i := range namesOrIDs { r, err := images.GetImage(ir.ClientCxt, i, &opts.Size) if err != nil { - return nil, err + errModel, ok := err.(entities.ErrorModel) + if !ok { + return nil, nil, err + } + if errModel.ResponseCode == 404 { + errs = append(errs, errors.Wrapf(err, "unable to inspect %q", i)) + continue + } + return nil, nil, err } reports = append(reports, r) } - return reports, nil + return reports, errs, nil } func (ir *ImageEngine) Load(ctx context.Context, opts entities.ImageLoadOptions) (*entities.ImageLoadReport, error) { |