summaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-01 22:54:22 +0200
committerGitHub <noreply@github.com>2020-04-01 22:54:22 +0200
commit0f357be5aeaa5dc651659cf0945a58780641e77d (patch)
tree77c502c42324db5aa5635b65f615c6a3c4e96fde /pkg/bindings
parent0a163720351710be314c729086e8d288680ff0a8 (diff)
parent8500ce6b9ab0050b925ec3b899495cb2cc8d367f (diff)
downloadpodman-0f357be5aeaa5dc651659cf0945a58780641e77d.tar.gz
podman-0f357be5aeaa5dc651659cf0945a58780641e77d.tar.bz2
podman-0f357be5aeaa5dc651659cf0945a58780641e77d.zip
Merge pull request #5686 from baude/v2load
podmanv2 load
Diffstat (limited to 'pkg/bindings')
-rw-r--r--pkg/bindings/images/images.go10
-rw-r--r--pkg/bindings/test/images_test.go4
2 files changed, 7 insertions, 7 deletions
diff --git a/pkg/bindings/images/images.go b/pkg/bindings/images/images.go
index ddc67bebc..6c739494b 100644
--- a/pkg/bindings/images/images.go
+++ b/pkg/bindings/images/images.go
@@ -91,11 +91,11 @@ func History(ctx context.Context, nameOrID string) ([]*handlers.HistoryResponse,
return history, response.Process(&history)
}
-func Load(ctx context.Context, r io.Reader, name *string) (string, error) {
- var id handlers.IDResponse
+func Load(ctx context.Context, r io.Reader, name *string) (*entities.ImageLoadReport, error) {
+ var report entities.ImageLoadReport
conn, err := bindings.GetClient(ctx)
if err != nil {
- return "", err
+ return nil, err
}
params := url.Values{}
if name != nil {
@@ -103,9 +103,9 @@ func Load(ctx context.Context, r io.Reader, name *string) (string, error) {
}
response, err := conn.DoRequest(r, http.MethodPost, "/images/load", params)
if err != nil {
- return "", err
+ return nil, err
}
- return id.ID, response.Process(&id)
+ return &report, response.Process(&report)
}
// Remove deletes an image from local storage. The optional force parameter will forcibly remove
diff --git a/pkg/bindings/test/images_test.go b/pkg/bindings/test/images_test.go
index dc01a793b..992720196 100644
--- a/pkg/bindings/test/images_test.go
+++ b/pkg/bindings/test/images_test.go
@@ -219,7 +219,7 @@ var _ = Describe("Podman images", func() {
Expect(err).To(BeNil())
names, err := images.Load(bt.conn, f, nil)
Expect(err).To(BeNil())
- Expect(names).To(Equal(alpine.name))
+ Expect(names.Name).To(Equal(alpine.name))
exists, err = images.Exists(bt.conn, alpine.name)
Expect(err).To(BeNil())
Expect(exists).To(BeTrue())
@@ -235,7 +235,7 @@ var _ = Describe("Podman images", func() {
newName := "quay.io/newname:fizzle"
names, err = images.Load(bt.conn, f, &newName)
Expect(err).To(BeNil())
- Expect(names).To(Equal(alpine.name))
+ Expect(names.Name).To(Equal(alpine.name))
exists, err = images.Exists(bt.conn, newName)
Expect(err).To(BeNil())
Expect(exists).To(BeTrue())