summaryrefslogtreecommitdiff
path: root/pkg/adapter/runtime.go
diff options
context:
space:
mode:
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