diff options
author | baude <bbaude@redhat.com> | 2020-12-14 08:52:00 -0600 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2020-12-15 16:04:59 -0600 |
commit | 8d4e19634cf73f257ca7f5d2c9506183f6a5b183 (patch) | |
tree | b2687888a89a443a4c85b191d42cd4d1a8049c8c /pkg/bindings/test/auth_test.go | |
parent | 0fd31e29948631c264df21a128b3de2700f7f007 (diff) | |
download | podman-8d4e19634cf73f257ca7f5d2c9506183f6a5b183.tar.gz podman-8d4e19634cf73f257ca7f5d2c9506183f6a5b183.tar.bz2 podman-8d4e19634cf73f257ca7f5d2c9506183f6a5b183.zip |
Podman image bindings for 3.0
Begin the migration of the image bindings for podman 3.0. this includes
the use of options for each binding. build was intentionally not
converted as I believe it needs more discussion before migration.
specifically, the build options themselves.
also noteworthly is that the remove image and remove images bindings
were merged into one. the remove images (or batch remove) has one
downside in that the errors return no longer adhere to http return
codes. this should be discussed and reimplemented in subsequent code.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/bindings/test/auth_test.go')
-rw-r--r-- | pkg/bindings/test/auth_test.go | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/pkg/bindings/test/auth_test.go b/pkg/bindings/test/auth_test.go index 4565b82b0..e647b3c36 100644 --- a/pkg/bindings/test/auth_test.go +++ b/pkg/bindings/test/auth_test.go @@ -9,7 +9,6 @@ import ( "github.com/containers/image/v5/types" podmanRegistry "github.com/containers/podman/v2/hack/podman-registry-go" "github.com/containers/podman/v2/pkg/bindings/images" - "github.com/containers/podman/v2/pkg/domain/entities" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" @@ -52,27 +51,19 @@ var _ = Describe("Podman images", func() { imageRef := imageRep + ":" + imageTag // Tag the alpine image and verify it has worked. - err = images.Tag(bt.conn, alpine.shortName, imageTag, imageRep) + err = images.Tag(bt.conn, alpine.shortName, imageTag, imageRep, nil) Expect(err).To(BeNil()) _, err = images.GetImage(bt.conn, imageRef, nil) Expect(err).To(BeNil()) // Now push the image. - pushOpts := entities.ImagePushOptions{ - Username: registry.User, - Password: registry.Password, - SkipTLSVerify: types.OptionalBoolTrue, - } - err = images.Push(bt.conn, imageRef, imageRef, pushOpts) + pushOpts := new(images.PushOptions) + err = images.Push(bt.conn, imageRef, imageRef, pushOpts.WithUsername(registry.User).WithPassword(registry.Password).WithSkipTLSVerify(true)) Expect(err).To(BeNil()) // Now pull the image. - pullOpts := entities.ImagePullOptions{ - Username: registry.User, - Password: registry.Password, - SkipTLSVerify: types.OptionalBoolTrue, - } - _, err = images.Pull(bt.conn, imageRef, pullOpts) + pullOpts := new(images.PullOptions) + _, err = images.Pull(bt.conn, imageRef, pullOpts.WithSkipTLSVerify(true).WithPassword(registry.Password).WithUsername(registry.User)) Expect(err).To(BeNil()) }) @@ -110,33 +101,24 @@ var _ = Describe("Podman images", func() { Expect(err).To(BeNil()) // Tag the alpine image and verify it has worked. - err = images.Tag(bt.conn, alpine.shortName, imageTag, imageRep) + err = images.Tag(bt.conn, alpine.shortName, imageTag, imageRep, nil) Expect(err).To(BeNil()) _, err = images.GetImage(bt.conn, imageRef, nil) Expect(err).To(BeNil()) // Now push the image. - pushOpts := entities.ImagePushOptions{ - Authfile: authFilePath, - SkipTLSVerify: types.OptionalBoolTrue, - } - err = images.Push(bt.conn, imageRef, imageRef, pushOpts) + pushOpts := new(images.PushOptions) + err = images.Push(bt.conn, imageRef, imageRef, pushOpts.WithAuthfile(authFilePath).WithSkipTLSVerify(true)) Expect(err).To(BeNil()) // Now pull the image. - pullOpts := entities.ImagePullOptions{ - Authfile: authFilePath, - SkipTLSVerify: types.OptionalBoolTrue, - } - _, err = images.Pull(bt.conn, imageRef, pullOpts) + pullOpts := new(images.PullOptions) + _, err = images.Pull(bt.conn, imageRef, pullOpts.WithAuthfile(authFilePath).WithSkipTLSVerify(true)) Expect(err).To(BeNil()) // Last, but not least, exercise search. - searchOptions := entities.ImageSearchOptions{ - Authfile: authFilePath, - SkipTLSVerify: types.OptionalBoolTrue, - } - _, err = images.Search(bt.conn, imageRef, searchOptions) + searchOptions := new(images.SearchOptions) + _, err = images.Search(bt.conn, imageRef, searchOptions.WithSkipTLSVerify(true).WithAuthfile(authFilePath)) Expect(err).To(BeNil()) }) |