Skip to content

Commit

Permalink
fix: /image/{name}/json returns RootFS layers
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vasek <[email protected]>
  • Loading branch information
matejvasek committed Oct 22, 2020
1 parent 2cb12bb commit 89e7b8f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/api/handlers/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,13 @@ func ImageDataToImageInspect(ctx context.Context, l *libpodImage.Image) (*ImageI
if err != nil {
return nil, err
}

rootfs := docker.RootFS{}
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,
Expand All @@ -286,7 +293,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,
Expand Down

0 comments on commit 89e7b8f

Please sign in to comment.