summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-23 07:01:03 -0400
committerGitHub <noreply@github.com>2020-10-23 07:01:03 -0400
commit51fa8ded9ffb7924288a2728ce92af7f6cc66d34 (patch)
treecc3940f6de21857a9fb864cc09577bb8c701eb3c /pkg
parent2adc1b284d7f61083d19e82822f79ea14c14de2d (diff)
parenta997b59e44d9b2648da2236220779f655b2f14e9 (diff)
downloadpodman-51fa8ded9ffb7924288a2728ce92af7f6cc66d34.tar.gz
podman-51fa8ded9ffb7924288a2728ce92af7f6cc66d34.tar.bz2
podman-51fa8ded9ffb7924288a2728ce92af7f6cc66d34.zip
Merge pull request #8109 from matejvasek/inspect-apiv2-rootfs
fix: /image/{name or id}/json returns RootFS layers
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/types.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/api/handlers/types.go b/pkg/api/handlers/types.go
index 70466f01b..6bb5f5101 100644
--- a/pkg/api/handlers/types.go
+++ b/pkg/api/handlers/types.go
@@ -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,