diff options
author | Brent Baude <bbaude@redhat.com> | 2020-05-13 09:34:46 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-05-13 09:41:39 -0500 |
commit | 3fea2f0a91fb62848d481e027fde7109cdb0ebeb (patch) | |
tree | 86022ba25f576b9ee35ca2494971886dc43c2aeb /pkg/bindings/images | |
parent | d147b3ee027580dd7afdeb0fa04d990ae1d2ee91 (diff) | |
download | podman-3fea2f0a91fb62848d481e027fde7109cdb0ebeb.tar.gz podman-3fea2f0a91fb62848d481e027fde7109cdb0ebeb.tar.bz2 podman-3fea2f0a91fb62848d481e027fde7109cdb0ebeb.zip |
enable remote image tree
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/bindings/images')
-rw-r--r-- | pkg/bindings/images/images.go | 18 |
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. |