fix(taglist): bug when listing multi-arch images (#260)

Support when registry server does not respect the [Manifest Specification](https://docs.docker.com/registry/spec/manifest-v2-2/#image-manifest-field-descriptions).
When the media type is `application/vnd.docker.distribution.manifest.list.v2+json` the response object must have a `layers` key, but sometimes you can have a `manifests` key...

fixes #260
This commit is contained in:
Joxit
2022-09-06 23:15:35 +02:00
parent ad7c2698fd
commit 57a1cf919a
3 changed files with 3 additions and 3 deletions

View File

@@ -109,7 +109,7 @@ export class DockerImage {
return;
}
self.ociImage = response.mediaType === 'application/vnd.oci.image.index.v1+json';
self.layers = self.ociImage ? response.manifests : response.layers;
self.layers = response.layers || response.manifests;
self.size = self.layers.reduce(function (acc, e) {
return acc + e.size;
}, 0);