Merge pull request #45587 from vvoland/c8d-layerless

c8d/list: Show layerless images
This commit is contained in:
Bjorn Neergaard 2023-05-19 11:17:58 -06:00 committed by GitHub
commit 87f8be8110
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -524,9 +524,12 @@ func getManifestPlatform(ctx context.Context, store content.Provider, manifestDe
return platforms.Normalize(platform), nil
}
// isImageManifest returns true if the manifest has any layer that is a known image layer.
// isImageManifest returns true if the manifest has no layers or any of its layers is a known image layer.
// Some manifests use the image media type for compatibility, even if they are not a real image.
func isImageManifest(mfst ocispec.Manifest) bool {
if len(mfst.Layers) == 0 {
return true
}
for _, l := range mfst.Layers {
if images.IsLayerType(l.MediaType) {
return true