From 9cd6bba5d57e7e23a92ab27e6c37f8623662d9b3 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Mon, 20 Apr 2020 10:02:35 -0700 Subject: V2 podman image tree * Basic port of V1 podman image tree ID TODO: Refactor to return tree from service and format in presentation layer TODO: Support tunneling mode Signed-off-by: Jhon Honce --- pkg/domain/infra/abi/images.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'pkg/domain/infra/abi') diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go index 0f710ad28..4353e0798 100644 --- a/pkg/domain/infra/abi/images.go +++ b/pkg/domain/infra/abi/images.go @@ -476,3 +476,15 @@ func (ir *ImageEngine) Build(ctx context.Context, containerFiles []string, opts } return &entities.BuildReport{ID: id}, nil } + +func (ir *ImageEngine) Tree(ctx context.Context, nameOrId string, opts entities.ImageTreeOptions) (*entities.ImageTreeReport, error) { + img, err := ir.Libpod.ImageRuntime().NewFromLocal(nameOrId) + if err != nil { + return nil, err + } + results, err := img.GenerateTree(opts.WhatRequires) + if err != nil { + return nil, err + } + return &entities.ImageTreeReport{Tree: results}, nil +} -- cgit v1.2.3-54-g00ecf