summaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-13 13:38:47 -0700
committerGitHub <noreply@github.com>2020-05-13 13:38:47 -0700
commitfa5b33e70b96ea8dfca3b46cab44a2e07028bf0c (patch)
tree8f20bbbf676ca47d8bcb3cf40d4c9f6b8e6c0fde /pkg/bindings
parent5e245b02e9330dab6b161b88b8c13978c27ff5d9 (diff)
parent3fea2f0a91fb62848d481e027fde7109cdb0ebeb (diff)
downloadpodman-fa5b33e70b96ea8dfca3b46cab44a2e07028bf0c.tar.gz
podman-fa5b33e70b96ea8dfca3b46cab44a2e07028bf0c.tar.bz2
podman-fa5b33e70b96ea8dfca3b46cab44a2e07028bf0c.zip
Merge pull request #6211 from baude/v2remoteimagetree
enable remote image tree
Diffstat (limited to 'pkg/bindings')
-rw-r--r--pkg/bindings/images/images.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/pkg/bindings/images/images.go b/pkg/bindings/images/images.go
index 034ade618..a15ce56e5 100644
--- a/pkg/bindings/images/images.go
+++ b/pkg/bindings/images/images.go
@@ -74,8 +74,22 @@ func GetImage(ctx context.Context, nameOrID string, size *bool) (*entities.Image
return &inspectedData, response.Process(&inspectedData)
}
-func Tree(ctx context.Context, nameOrId string) error {
- return bindings.ErrNotImplemented
+// Tree retrieves a "tree" based representation of the given image
+func Tree(ctx context.Context, nameOrId string, whatRequires *bool) (*entities.ImageTreeReport, error) {
+ var report entities.ImageTreeReport
+ conn, err := bindings.GetClient(ctx)
+ if err != nil {
+ return nil, err
+ }
+ params := url.Values{}
+ if whatRequires != nil {
+ params.Set("size", strconv.FormatBool(*whatRequires))
+ }
+ response, err := conn.DoRequest(nil, http.MethodGet, "/images/%s/tree", params, nameOrId)
+ if err != nil {
+ return nil, err
+ }
+ return &report, response.Process(&report)
}
// History returns the parent layers of an image.