Limit multiple platform manifests to one for size check

client.Pull will only pull one matching platform by default.
When checking the size of image we match that behavior so that
we don't look for multiple platforms that might not exist on disk.

Signed-off-by: Darren Shepherd <darren@rancher.com>
(cherry picked from commit 1161409779)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
Darren Shepherd
2019-08-02 18:40:35 -07:00
committed by Wei Fu
parent 6e4353d6a9
commit 47e5d5fd44

View File

@@ -119,7 +119,7 @@ func (image *Image) Size(ctx context.Context, provider content.Provider, platfor
}
size += desc.Size
return nil, nil
}), FilterPlatforms(ChildrenHandler(provider), platform)), image.Target)
}), LimitManifests(FilterPlatforms(ChildrenHandler(provider), platform), platform, 1)), image.Target)
}
type platformManifest struct {