summaryrefslogtreecommitdiff
path: root/pkg/adapter/runtime.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-02-17 17:24:28 +0100
committerGitHub <noreply@github.com>2020-02-17 17:24:28 +0100
commit640b11f0028057ca2090d61c4e460c1afadb226c (patch)
tree797e7b98b6efe2b0bdb74e93146b53c798367308 /pkg/adapter/runtime.go
parentff0f8388138f7b66c4312db0e984f0bedcac2558 (diff)
parent93358ef915f639e52088b0f6aec52e77d3da0af7 (diff)
downloadpodman-640b11f0028057ca2090d61c4e460c1afadb226c.tar.gz
podman-640b11f0028057ca2090d61c4e460c1afadb226c.tar.bz2
podman-640b11f0028057ca2090d61c4e460c1afadb226c.zip
Merge pull request #5093 from openSUSE/image-tree
Refactor image tree for API usage
Diffstat (limited to 'pkg/adapter/runtime.go')
-rw-r--r--pkg/adapter/runtime.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/adapter/runtime.go b/pkg/adapter/runtime.go
index 40089797d..dfe6b7f07 100644
--- a/pkg/adapter/runtime.go
+++ b/pkg/adapter/runtime.go
@@ -133,6 +133,15 @@ func (r *LocalRuntime) NewImageFromLocal(name string) (*ContainerImage, error) {
return &ContainerImage{img}, nil
}
+// ImageTree reutnrs an new image.Tree for the provided `imageOrID` and `whatrequires` flag
+func (r *LocalRuntime) ImageTree(imageOrID string, whatRequires bool) (string, error) {
+ img, err := r.Runtime.ImageRuntime().NewFromLocal(imageOrID)
+ if err != nil {
+ return "", err
+ }
+ return img.GenerateTree(whatRequires)
+}
+
// LoadFromArchiveReference calls into local storage to load an image from an archive
func (r *LocalRuntime) LoadFromArchiveReference(ctx context.Context, srcRef types.ImageReference, signaturePolicyPath string, writer io.Writer) ([]*ContainerImage, error) {
var containerImages []*ContainerImage