c8d/list: Skip images with non matching platform
Currently this won't have any real effect because the platform matcher matches all platform and is only used for sorting. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
72f1f82f28
commit
2f1a32e3e5
1 changed files with 8 additions and 0 deletions
|
@ -262,6 +262,14 @@ func (i *ImageService) imageSummary(ctx context.Context, img images.Image, platf
|
|||
platform = dockerImage.Platform
|
||||
}
|
||||
|
||||
// Filter out platforms that don't match the requested platform. Do it
|
||||
// after the size, container count and chainIDs are summed up to have
|
||||
// the single combined entry still represent the whole multi-platform
|
||||
// image.
|
||||
if !platformMatcher.Match(platform) {
|
||||
return nil
|
||||
}
|
||||
|
||||
if best == nil || platformMatcher.Less(platform, bestPlatform) {
|
||||
best = img
|
||||
bestPlatform = platform
|
||||
|
|
Loading…
Reference in a new issue