From 89e7b8f22bec9b6f298eeca8ea7bbc9bc6b32c1d Mon Sep 17 00:00:00 2001 From: Matej Vasek Date: Thu, 22 Oct 2020 17:07:03 +0200 Subject: fix: /image/{name}/json returns RootFS layers Signed-off-by: Matej Vasek --- pkg/api/handlers/types.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/api/handlers/types.go b/pkg/api/handlers/types.go index 70466f01b..0851f48de 100644 --- a/pkg/api/handlers/types.go +++ b/pkg/api/handlers/types.go @@ -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, @@ -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, -- cgit v1.2.3-54-g00ecf