c8d/list: Fix premature Images
return
52a80b40e2
extracted the `imageSummary`
function but introduced a bug causing the whole caller function to
return if the image should be skipped.
`imageSummary` returns a nil error and nil image when the image doesn't
have any platform or all its platforms are not available locally.
In this case that particular image should be skipped, instead of failing
the whole image list operation.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
a9bca45e92
commit
f512dba037
1 changed files with 5 additions and 1 deletions
|
@ -154,9 +154,13 @@ func (i *ImageService) Images(ctx context.Context, opts imagetypes.ListOptions)
|
|||
|
||||
for _, img := range uniqueImages {
|
||||
image, allChainsIDs, err := i.imageSummary(ctx, img, platformMatcher, opts, tagsByDigest)
|
||||
if err != nil || image == nil {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// No error, but image should be skipped.
|
||||
if image == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
summaries = append(summaries, image)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue