diff options
author | baude <bbaude@redhat.com> | 2020-12-14 11:33:25 -0600 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2020-12-17 09:40:51 -0600 |
commit | 86335aa4ae01dadecd36468409d742e68b76925d (patch) | |
tree | fd6e5bfeb924db9020073685d0133b2fa38622c1 /pkg/bindings/test/manifests_test.go | |
parent | c38ae47a1adf3235d8b01d724e7327e608dd8078 (diff) | |
download | podman-86335aa4ae01dadecd36468409d742e68b76925d.tar.gz podman-86335aa4ae01dadecd36468409d742e68b76925d.tar.bz2 podman-86335aa4ae01dadecd36468409d742e68b76925d.zip |
misc bindings to podman v3
manifest, system, info, volumes, play, and generate bindings are
updated to always have binding options.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/bindings/test/manifests_test.go')
-rw-r--r-- | pkg/bindings/test/manifests_test.go | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/pkg/bindings/test/manifests_test.go b/pkg/bindings/test/manifests_test.go index 421004b8c..b93f64b4b 100644 --- a/pkg/bindings/test/manifests_test.go +++ b/pkg/bindings/test/manifests_test.go @@ -4,7 +4,6 @@ import ( "net/http" "time" - "github.com/containers/podman/v2/libpod/image" "github.com/containers/podman/v2/pkg/bindings" "github.com/containers/podman/v2/pkg/bindings/images" "github.com/containers/podman/v2/pkg/bindings/manifests" @@ -37,7 +36,7 @@ var _ = Describe("Podman containers ", func() { // create manifest list without images id, err := manifests.Create(bt.conn, []string{"quay.io/libpod/foobar:latest"}, []string{}, nil) Expect(err).To(BeNil()) - list, err := manifests.Inspect(bt.conn, id) + list, err := manifests.Inspect(bt.conn, id, nil) Expect(err).To(BeNil()) Expect(len(list.Manifests)).To(BeZero()) @@ -53,13 +52,13 @@ var _ = Describe("Podman containers ", func() { // create manifest list with images id, err = manifests.Create(bt.conn, []string{"quay.io/libpod/foobar:latest"}, []string{alpine.name}, nil) Expect(err).To(BeNil()) - list, err = manifests.Inspect(bt.conn, id) + list, err = manifests.Inspect(bt.conn, id, nil) Expect(err).To(BeNil()) Expect(len(list.Manifests)).To(BeNumerically("==", 1)) }) It("inspect bogus manifest", func() { - _, err := manifests.Inspect(bt.conn, "larry") + _, err := manifests.Inspect(bt.conn, "larry", nil) Expect(err).ToNot(BeNil()) code, _ := bindings.CheckResponseCode(err) Expect(code).To(BeNumerically("==", http.StatusNotFound)) @@ -67,23 +66,23 @@ var _ = Describe("Podman containers ", func() { It("add manifest", func() { // add to bogus should 404 - _, err := manifests.Add(bt.conn, "foobar", image.ManifestAddOpts{}) + _, err := manifests.Add(bt.conn, "foobar", nil) Expect(err).ToNot(BeNil()) code, _ := bindings.CheckResponseCode(err) Expect(code).To(BeNumerically("==", http.StatusNotFound)) id, err := manifests.Create(bt.conn, []string{"quay.io/libpod/foobar:latest"}, []string{}, nil) Expect(err).To(BeNil()) - opts := image.ManifestAddOpts{Images: []string{alpine.name}} - _, err = manifests.Add(bt.conn, id, opts) + options := new(manifests.AddOptions).WithImages([]string{alpine.name}) + _, err = manifests.Add(bt.conn, id, options) Expect(err).To(BeNil()) - list, err := manifests.Inspect(bt.conn, id) + list, err := manifests.Inspect(bt.conn, id, nil) Expect(err).To(BeNil()) Expect(len(list.Manifests)).To(BeNumerically("==", 1)) // add bogus name to existing list should fail - opts.Images = []string{"larry"} - _, err = manifests.Add(bt.conn, id, opts) + options.WithImages([]string{"larry"}) + _, err = manifests.Add(bt.conn, id, options) Expect(err).ToNot(BeNil()) code, _ = bindings.CheckResponseCode(err) Expect(code).To(BeNumerically("==", http.StatusInternalServerError)) @@ -91,29 +90,29 @@ var _ = Describe("Podman containers ", func() { It("remove manifest", func() { // removal on bogus manifest list should be 404 - _, err := manifests.Remove(bt.conn, "larry", "1234") + _, err := manifests.Remove(bt.conn, "larry", "1234", nil) Expect(err).ToNot(BeNil()) code, _ := bindings.CheckResponseCode(err) Expect(code).To(BeNumerically("==", http.StatusNotFound)) id, err := manifests.Create(bt.conn, []string{"quay.io/libpod/foobar:latest"}, []string{alpine.name}, nil) Expect(err).To(BeNil()) - data, err := manifests.Inspect(bt.conn, id) + data, err := manifests.Inspect(bt.conn, id, nil) Expect(err).To(BeNil()) Expect(len(data.Manifests)).To(BeNumerically("==", 1)) // removal on a good manifest list with a bad digest should be 400 - _, err = manifests.Remove(bt.conn, id, "!234") + _, err = manifests.Remove(bt.conn, id, "!234", nil) Expect(err).ToNot(BeNil()) code, _ = bindings.CheckResponseCode(err) Expect(code).To(BeNumerically("==", http.StatusBadRequest)) digest := data.Manifests[0].Digest.String() - _, err = manifests.Remove(bt.conn, id, digest) + _, err = manifests.Remove(bt.conn, id, digest, nil) Expect(err).To(BeNil()) // removal on good manifest with good digest should work - data, err = manifests.Inspect(bt.conn, id) + data, err = manifests.Inspect(bt.conn, id, nil) Expect(err).To(BeNil()) Expect(len(data.Manifests)).To(BeZero()) }) |