summaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-02 14:20:57 +0200
committerGitHub <noreply@github.com>2020-04-02 14:20:57 +0200
commit82610d657d58b3da68c5af35cef7470b0819636b (patch)
tree3ebb74110eb8ab718c23d4fa6312b67f226258e0 /pkg/bindings
parent88455fe704023d65b782e70fc774128b3ec76569 (diff)
parent043308198337941a8086113619d6341528c10cd0 (diff)
downloadpodman-82610d657d58b3da68c5af35cef7470b0819636b.tar.gz
podman-82610d657d58b3da68c5af35cef7470b0819636b.tar.bz2
podman-82610d657d58b3da68c5af35cef7470b0819636b.zip
Merge pull request #5688 from baude/v2import
podmanv2 import
Diffstat (limited to 'pkg/bindings')
-rw-r--r--pkg/bindings/images/images.go12
1 files changed, 6 insertions, 6 deletions
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