Merge pull request #8109 from matejvasek/inspect-apiv2-rootfs

fix: /image/{name or id}/json returns RootFS layers
This commit is contained in:
OpenShift Merge Robot 2020-10-23 07:01:03 -04:00 committed by GitHub
commit 51fa8ded9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -271,6 +271,15 @@ func ImageDataToImageInspect(ctx context.Context, l *libpodImage.Image) (*ImageI
if err != nil {
return nil, err
}
rootfs := docker.RootFS{}
if info.RootFS != nil {
rootfs.Type = info.RootFS.Type
rootfs.Layers = make([]string, 0, len(info.RootFS.Layers))
for _, layer := range info.RootFS.Layers {
rootfs.Layers = append(rootfs.Layers, string(layer))
}
}
dockerImageInspect := docker.ImageInspect{
Architecture: l.Architecture,
Author: l.Author,
@ -286,7 +295,7 @@ func ImageDataToImageInspect(ctx context.Context, l *libpodImage.Image) (*ImageI
Parent: l.Parent,
RepoDigests: info.RepoDigests,
RepoTags: info.RepoTags,
RootFS: docker.RootFS{},
RootFS: rootfs,
Size: info.Size,
Variant: "",
VirtualSize: info.VirtualSize,