summaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-03-31 12:59:08 -0500
committerBrent Baude <bbaude@redhat.com>2020-04-01 14:10:57 -0500
commit8500ce6b9ab0050b925ec3b899495cb2cc8d367f (patch)
tree554448ea6140ef2a2814fe44b41b5da6f86b06f3 /pkg/bindings
parentd534e524272121a6489c1a2a2c11c6b389027ecd (diff)
downloadpodman-8500ce6b9ab0050b925ec3b899495cb2cc8d367f.tar.gz
podman-8500ce6b9ab0050b925ec3b899495cb2cc8d367f.tar.bz2
podman-8500ce6b9ab0050b925ec3b899495cb2cc8d367f.zip
podmanv2 load
enable podman load for v2 add reexec into main add systemd build flag to v2 makefile Signed-off-by: Brent Baude <bbaude@redhat.com>
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())