summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorMatej Vasek <mvasek@redhat.com>2020-10-22 17:07:03 +0200
committerMatej Vasek <mvasek@redhat.com>2020-10-22 17:09:44 +0200
commit89e7b8f22bec9b6f298eeca8ea7bbc9bc6b32c1d (patch)
treeaf014345e1ca6c40fd342dafce9c75f7c50c83fd /pkg/api
parent2cb12bbc5a832e5b69d3b52480377df716dc543b (diff)
downloadpodman-89e7b8f22bec9b6f298eeca8ea7bbc9bc6b32c1d.tar.gz
podman-89e7b8f22bec9b6f298eeca8ea7bbc9bc6b32c1d.tar.bz2
podman-89e7b8f22bec9b6f298eeca8ea7bbc9bc6b32c1d.zip
fix: /image/{name}/json returns RootFS layers
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/types.go9
1 files changed, 8 insertions, 1 deletions
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,