From 043308198337941a8086113619d6341528c10cd0 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Tue, 31 Mar 2020 14:45:19 -0500 Subject: podmanv2 import add the ability to import a container image from a container export Signed-off-by: Brent Baude --- pkg/bindings/images/images.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pkg/bindings') diff --git a/pkg/bindings/images/images.go b/pkg/bindings/images/images.go index 6c739494b..470ce546c 100644 --- a/pkg/bindings/images/images.go +++ b/pkg/bindings/images/images.go @@ -217,14 +217,14 @@ func Build(nameOrId string) {} // Imports adds the given image to the local image store. This can be done by file and the given reader // or via the url parameter. Additional metadata can be associated with the image by using the changes and // message parameters. The image can also be tagged given a reference. One of url OR r must be provided. -func Import(ctx context.Context, changes []string, message, reference, u *string, r io.Reader) (string, error) { - var id handlers.IDResponse +func Import(ctx context.Context, changes []string, message, reference, u *string, r io.Reader) (*entities.ImageImportReport, error) { + var report entities.ImageImportReport if r != nil && u != nil { - return "", errors.New("url and r parameters cannot be used together") + return nil, errors.New("url and r parameters cannot be used together") } conn, err := bindings.GetClient(ctx) if err != nil { - return "", err + return nil, err } params := url.Values{} for _, change := range changes { @@ -241,9 +241,9 @@ func Import(ctx context.Context, changes []string, message, reference, u *string } response, err := conn.DoRequest(r, http.MethodPost, "/images/import", params) if err != nil { - return "", err + return nil, err } - return id.ID, response.Process(&id) + return &report, response.Process(&report) } // Pull is the binding for libpod's v2 endpoints for pulling images. Note that -- cgit v1.2.3-54-g00ecf