summaryrefslogtreecommitdiff
path: root/pkg/bindings/test/images_test.go
Commit message (Collapse)AuthorAge
* Add ProgressWriter to PullOptionsVladimir Kochnev2022-08-19
| | | | Signed-off-by: Vladimir Kochnev <hashtable@yandex.ru>
* pkg/bindings: Support writing image push progress to specified io.WriterNaoto Kobayashi2022-08-08
| | | | | | | | | Currently bindings writes image push progress to os.Stderr. Since os.Stderr is inconvenience for bindings caller to process the progress messages, Added this support. Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
* Semiperiodoc cleanup of obsolete FIXMEsEd Santiago2022-07-25
| | | | | | | | | | | | | | | | Some refer to issues that are closed. Remove them. Some are runc bugs that will never be fixed. Say so, and remove the FIXME. One (bps/iops) should probably be fixed. File an issue for it, and update comment to include the issue# so my find-obsolete-skips script can track it. And one (rootless mount with a "kernel bug?" comment) is still not fixed. Leave the skip, but add a comment documenting the symptom. Signed-off-by: Ed Santiago <santiago@redhat.com>
* enable staticcheck linterPaul Holzinger2022-04-22
| | | | | | | Fix many problems reported by the staticcheck linter, including many real bugs! Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* bump go module to version 4Valentin Rothberg2022-01-18
| | | | | | | | | | | | | Automated for .go files via gomove [1]: `gomove github.com/containers/podman/v3 github.com/containers/podman/v4` Remaining files via vgrep [2]: `vgrep github.com/containers/podman/v3` [1] https://github.com/KSubedi/gomove [2] https://github.com/vrothberg/vgrep Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* bindings rmi test: clarify behaviorValentin Rothberg2021-12-16
| | | | | | | | | | | | | | | | | | The libpod/images/remove endpoint is not very REST-ish but, after some debate, was decided to be implemented as for the following reasons. First, it allows for batch removing images which improves performance significantly. Note that Docker does support `rmi -a`! Second, it allows for hiding the logic of setting the right exit code to use from the client and keep all the logic on the server. Hence, when removing an image that does not exist, the server will return a 200. The response, however, includes the error message to be used *and* the exit code that podman-remote will use. Fixes: #12441 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* e2e tests: enable golintEd Santiago2021-11-29
| | | | | | ...and fix problems found therewith. Signed-off-by: Ed Santiago <santiago@redhat.com>
* Add guard for BuildOptions.CommonBuildOptsJhon Honce2021-09-30
| | | | | | | Existing images.Build() bindings code panicked when field was not initialized. Signed-off-by: Jhon Honce <jhonce@redhat.com>
* migrate Podman to containers/common/libimageValentin Rothberg2021-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate the Podman code base over to `common/libimage` which replaces `libpod/image` and a lot of glue code entirely. Note that I tried to leave bread crumbs for changed tests. Miscellaneous changes: * Some errors yield different messages which required to alter some tests. * I fixed some pre-existing issues in the code. Others were marked as `//TODO`s to prevent the PR from exploding. * The `NamesHistory` of an image is returned as is from the storage. Previously, we did some filtering which I think is undesirable. Instead we should return the data as stored in the storage. * Touched handlers use the ABI interfaces where possible. * Local image resolution: previously Podman would match "foo" on "myfoo". This behaviour has been changed and Podman will now only match on repository boundaries such that "foo" would match "my/foo" but not "myfoo". I consider the old behaviour to be a bug, at the very least an exotic corner case. * Futhermore, "foo:none" does *not* resolve to a local image "foo" without tag anymore. It's a hill I am (almost) willing to die on. * `image prune` prints the IDs of pruned images. Previously, in some cases, the names were printed instead. The API clearly states ID, so we should stick to it. * Compat endpoint image removal with _force_ deletes the entire not only the specified tag. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Use version package to track all versionsJhon Honce2021-03-03
| | | | | | | | | | | | * Server, bindings, and CLI all now pull version information from version package. * Current /libpod API version slaved to podman/libpod Version * Bindings validate against libpod API Minimal version * Remove pkg/bindings/bindings.go and updated tests Fixes: #9207 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* bump go module to v3Valentin Rothberg2021-02-22
| | | | | | | | | We missed bumping the go module, so let's do it now :) * Automated go code with github.com/sirkon/go-imports-rename * Manually via `vgrep podman/v2` the rest Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Add binding options for container|pod existsbaude2021-01-18
| | | | | | | | It turns out an options was added to container exists so it makes sense to have pods and container exists calls have an optional structure for options. Signed-off-by: baude <bbaude@redhat.com>
* Remove the ability to use [name:tag] in podman load commandDaniel J Walsh2021-01-12
| | | | | | | | | | Docker does not support this, and it is confusing what to do if the image has more then one tag. We are dropping support for this in podman 3.0 Fixes: https://github.com/containers/podman/issues/7387 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Rework pruning to report reclaimed spaceBaron Lenardson2020-12-30
| | | | | | | | | | | | This change adds code to report the reclaimed space after a prune. Reclaimed space from volumes, images, and containers is recorded during the prune call in a PruneReport struct. These structs are collected into a slice during a system prune and processed afterwards to calculate the total reclaimed space. Closes #8658 Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
* SpellingJosh Soref2020-12-22
| | | | Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* podman v3 container bindingsbaude2020-12-21
| | | | | | | convert the golang container bindings to all use options so that changes in the future are more managable. Signed-off-by: baude <bbaude@redhat.com>
* Podman image bindings for 3.0baude2020-12-15
| | | | | | | | | | | | | | 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>
* Bindings refactorbaude2020-12-10
| | | | | | | | | | | this is step one of refactoring our golang binaries. we will no be using structs to pass optional options. required options will still arguments to the binding itself. the structs then have a generator to create helper functions which should then be added to the git repo. Signed-off-by: baude <bbaude@redhat.com>
* move from docker.ioEd Santiago2020-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Followon to #7965 (mirror registry). mirror.gcr.io doesn't cache all the images we need, and I can't find a way to add to its cache, so let's just use quay.io for those images that it can't serve. Tools used: skopeo copy --all docker://docker.io/library/alpine:3.10.2 \ docker://quay.io/libpod/alpine:3.10.2 ...and also: docker.io/library/alpine:3.2 docker.io/library/busybox:latest docker.io/library/busybox:glibc docker.io/library/busybox:1.30.1 docker.io/library/redis:alpine docker.io/libpod/alpine-with-bogus-seccomp:label docker.io/libpod/alpine-with-seccomp:label docker.io/libpod/alpine_healthcheck:latest docker.io/libpod/badhealthcheck:latest Since most of those were new quay.io/libpod images, they required going in through the quay.io GUI, image, settings, Make Public. Signed-off-by: Ed Santiago <santiago@redhat.com>
* Restore 'id' stanza in pull resultsJhon Honce2020-09-21
| | | | | | | | | | | | | id is the last image id from the set of id's returned via the images stanza. id may be deprecated in a future version of the API Created test_rest_v2_0_0.py to reflect the bump in the API Version. Fixes #7686 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Switch all references to github.com/containers/libpod -> podmanDaniel J Walsh2020-07-28
| | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* move go module to v2Valentin Rothberg2020-07-06
| | | | | | | | | | | | | | | With the advent of Podman 2.0.0 we crossed the magical barrier of go modules. While we were able to continue importing all packages inside of the project, the project could not be vendored anymore from the outside. Move the go module to new major version and change all imports to `github.com/containers/libpod/v2`. The renaming of the imports was done via `gomove` [1]. [1] https://github.com/KSubedi/gomove Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Make convenience boxed true/false easier to useJhon Honce2020-05-14
| | | | | | | * changed PFalse to &false * changed PTrue to &true Signed-off-by: Jhon Honce <jhonce@redhat.com>
* image removal: refactor part 2Valentin Rothberg2020-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Continue the refactoring of image removal. I didn't manage to break all the following changes into smaller and easier to digest commits due to time constraints: * Return an error slice instead of a single error. Use multierror only in the client/frontend. Reflect that in the types. * Use the batch image removal in the client while preserving the more rest-idiomatic single-image removal endpoint. * Add a new handler for the single-image removal endpoint to make it share the same code as the batch endpoint. * Expose bindings for the single and batch endpoints, so we can properly test them. * Add several convenience functions for error handling to pkg/errorhandling. * Set the correct error type in libpod to set the exit code to 2 when one or more containers are using an image. * Massage the bindings tests a bit and tackle compilation errors. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* podmanV2: implement searchValentin Rothberg2020-04-09
| | | | | | | | Also implement a new libpod endpoint to add more parameters and to prevent us from converting between slices and maps and make use of the filter parsing in the image backend. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* podmanv2 loadBrent Baude2020-04-01
| | | | | | | | | | enable podman load for v2 add reexec into main add systemd build flag to v2 makefile Signed-off-by: Brent Baude <bbaude@redhat.com>
* podmanV2: implement pullValentin Rothberg2020-03-31
| | | | | | | | | | | | | Implement pulling images for the v2 client. What I _really_ don't like is the fact that we are now having a near identical code clone among `pkg/domain/infra/abi` and `pkg/api/handlers/libpod`. Partly because we don't yet have a higher-level pull function and partly because we have redudancy among `pkg/domain` and `pkg/api`. Pull might be a high outlier but I am concerned already by the potential of introducing more redundancy. I'd love to `infra/abi` and `pkg/abi` to really use the same code in the future. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* V2 podman image pruneJhon Honce2020-03-26
| | | | | | | | | * Fixed header for `podman image ls` * Implemented prune `all` flag, preserved filter method for backwards capability * Updated binding tests Signed-off-by: Jhon Honce <jhonce@redhat.com>
* apiv2 add bindings for logs|eventsBrent Baude2020-03-19
| | | | | | add go-bindings for logs and events. tests were also added. Signed-off-by: Brent Baude <bbaude@redhat.com>
* Fix spelling mistakes in code found by codespellDaniel J Walsh2020-03-07
| | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* add default network for apiv2 createBrent Baude2020-03-06
| | | | | | | | | | | | | during container creation, if no network is provided, we need to add a default value so the container can be later started. use apiv2 container creation for RunTopContainer instead of an exec to the system podman. RunTopContainer now also returns the container id and an error. added a libpod commit endpoint. also, changed the use of the connections and bindings slightly to make it more convenient to write tests. Fixes: 5366 Signed-off-by: Brent Baude <bbaude@redhat.com>
* more image binding testsBrent Baude2020-02-23
| | | | | | | | add two additional bindings tests for image usage. add ability to use search filter on the endpoint. Signed-off-by: Brent Baude <bbaude@redhat.com>
* add more image tests for go bindingsBrent Baude2020-02-21
| | | | | | adding more image tests for go bindings. one big change is that the params were converted from map[string]string to url.values to account for the ability to send []string as query params Signed-off-by: Brent Baude <bbaude@redhat.com>
* Add support for ssh:// and unix:// podman clientsJhon Honce2020-02-20
| | | | | | | | | | * Make context keys package safe * Add support for PODMAN_HOST and PODMAN_SSHKEY * Add slight increasing delay when client connections fail * Remove usages of path.Join(), added JoinURL(). '/' is not OS dependent. Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Add test to validate the pod bindings apiSujil022020-02-19
| | | | | | | | Include test to validate pod create, start, stop, restart, pause, unpause, list, and inspect api bindings. Also includes bug fixes that resulted in invalid api responses. Signed-off-by: Sujil02 <sushah@redhat.com>
* add caching for binding testsBrent Baude2020-02-14
| | | | | | | | add the ability to cache images instead of pull them. makes tests faster and less network use when we flip on CI. Also added list images with filter test Signed-off-by: Brent Baude <bbaude@redhat.com>
* Add test cases to validate remove and list images api.Sujil022020-02-10
| | | | | | | Includes testcase to validate list image api count as we create and delete images Include testcase to validate remove image api responses with container instance, etc. Signed-off-by: Sujil02 <sushah@redhat.com>
* Add a binding test to check image tag and list commands.Sujil022020-02-03
| | | | | | | | Include testcase to validate tag api responses and check if all the image instaces are shown list command. Also, Update the binding process and the response Signed-off-by: Sujil02 <sushah@redhat.com>
* fix longname handling for bindingsBrent Baude2020-01-31
| | | | | | the api needs to account for image input where the image is encoded as a fqd image name. Signed-off-by: Brent Baude <bbaude@redhat.com>
* apiv2 binding test fixesBrent Baude2020-01-29
| | | | | | a recent refactor in the bindings broke the tests. quick fixes to get them working again. Signed-off-by: Brent Baude <bbaude@redhat.com>
* [CI:DOCS]Binding overhaulsBrent Baude2020-01-28
Add binding for networks and begin documentation for binding methods for godoc. Also, add major functions to their own subpackages so reduce the amount of of method confusion. So instead of: bindings.ListImages(), we now do a [bindings].images.List(). Also, the connection is passed to each binding method via a context to allow for future growth. Lastly, add first set of tests. There are a couple of things to work out for rootless tests yet. Signed-off-by: Brent Baude <bbaude@redhat.com>