summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat
Commit message (Collapse)AuthorAge
* add network prunebaude2021-02-06
| | | | | | | | | add the ability to prune unused cni networks. filters are not implemented but included both compat and podman api endpoints. Fixes :#8673 Signed-off-by: baude <bbaude@redhat.com>
* Implement Docker wait conditionsMatej Vasek2021-02-03
| | | | Signed-off-by: Matej Vasek <mvasek@redhat.com>
* Merge pull request #9188 from jwhonce/issues/8865OpenShift Merge Robot2021-02-03
|\ | | | | Report StatusConflict on Pod opt partial failures
| * Report StatusConflict on Pod opt partial failuresJhon Honce2021-02-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - When one or more containers in the Pod reports an error on an operation report StatusConflict and report the error(s) - jsoniter type encoding used to marshal error as string using error.Error() - Update test framework to allow setting any flag when creating pods - Fix test_resize() result check Fixes #8865 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | Fix invalid wait condition on killDaniel J Walsh2021-02-03
|/ | | | | | | | | | | When using the compatability tests on kill, the kill function goes into an infinite wait loop taking all of the CPU. This change will use the correct wait function and exit properly. Fixes: https://github.com/containers/podman/issues/9206 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #9051 from rhatdan/rmOpenShift Merge Robot2021-02-01
|\ | | | | Switch podman stop/kill/wait handlers to use abi
| * Switch podman stop/kill/wait handlers to use abiDaniel J Walsh2021-01-29
| | | | | | | | | | | | | | | | | | | | | | | | Change API Handlers to use the same functions that the local podman uses. At the same time: implement remote API for --all and --ignore flags for podman stop implement remote API for --all flags for podman stop Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | Endpoint that lists containers does not return correct Status valueMilivoje Legenovic2021-01-31
|/ | | | | | | | | Eclipse and Intellij Docker plugin determines the state of the container via the Status field, returned from /containers/json call. Podman always returns empty string, and because of that, both IDEs show the wrong state of the container. Signed-off-by: Milivoje Legenovic <m.legenovic@gmail.com>
* Podman-remote push can support --formatDaniel J Walsh2021-01-29
| | | | | | | | Fix man page to document podman push --format fully. Also found that push was not handling the tlsverify so fixed this. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #9115 from rhatdan/pullOpenShift Merge Robot2021-01-28
|\ | | | | Switch podman image push handlers to use abi
| * Switch podman image push handlers to use abiDaniel J Walsh2021-01-27
| | | | | | | | | | | | | | | | | | | | | | | | Change API Handlers to use the same functions that the local podman uses. At the same time: Cleanup and pass proper bindings. Remove cli options from podman-remote push. Cleanup manifest push. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | podman-remote ps --external --pod --sort do not work.Daniel J Walsh2021-01-27
|/ | | | | | | | | | Fixup the bindings and the handling of the --external --por and --sort flags. The --storage option was renamed --external, make sure we use external up and down the stack. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Fixup searchDaniel J Walsh2021-01-25
| | | | | | | | | | | | | | | | | podman-remote search had some FIXMEs in tests that were failing. So I reworked the search handler to use the local abi. This means the podman search and podman-remote search will use the same functions. While doing this, I noticed we were just outputing errors via logrus.Error rather then returning them, which works ok for podman but the messages get lost on podman-remote. Changed the code to actually return the error messages to the caller. This allows us to turn on the remaining podman-remote FIXME tests. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #9036 from baude/composelogOpenShift Merge Robot2021-01-21
|\ | | | | Set log driver for compatibility containers
| * Set log driver for compatability containersbaude2021-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when using the compatibility api to create containers, now reflect the use of k8s-file as json-file so that clients, which are unaware of k8s-file, can work. specifically, if the container is using k8s-file as the log driver, we change the log type in container inspection to json-file. These terms are used interchangably in other locations in libpod/podman. this fixes log messages in compose as well. [NO TESTS NEEDED] Signed-off-by: baude <bbaude@redhat.com>
* | Fix handling of container removeDaniel J Walsh2021-01-20
|/ | | | | | | | | | | | | | | | | | | | I found several problems with container remove podman-remote rm --all Was not handled podman-remote rm --ignore Was not handled Return better errors when attempting to remove an --external container. Currently we return the container does not exists, as opposed to container is an external container that is being used. This patch also consolidates the tunnel code to use the same code for removing the container, as the local API, removing duplication of code and potential problems. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #8955 from mheon/renameOpenShift Merge Robot2021-01-14
|\ | | | | Container Rename
| * Initial implementation of renaming containersMatthew Heon2021-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basic theory: We remove the container, but *only from the DB*. We leave it in c/storage, we leave the lock allocated, we leave it running (if it is). Then we create an identical container with an altered name, and add that back to the database. Theoretically we now have a renamed container. The advantage of this approach is that it doesn't just apply to rename - we can use this to make *any* configuration change to a container that does not alter its container ID. Potential problems are numerous. This process is *THOROUGHLY* non-atomic at present - if you `kill -9` Podman mid-rename things will be in a bad place, for example. Also, we can't rename containers that can't be removed normally - IE, containers with dependencies (pod infra containers, for example). The largest potential improvement will be to move the majority of the work into the DB, with a `RecreateContainer()` method - that will add atomicity, and let us remove the container without worrying about depencies and similar issues. Potential problems: long-running processes that edit the DB and may have an older version of the configuration around. Most notable example is `podman run --rm` - the removal command needed to be manually edited to avoid this one. This begins to get at the heart of me not wanting to do this in the first place... This provides CLI and API implementations for frontend, but no tunnel implementation. It will be added in a future release (just held back for time now - we need this in 3.0 and are running low on time). This is honestly kind of horrifying, but I think it will work. Signed-off-by: Matthew Heon <mheon@redhat.com>
* | Initial implementation of volume pluginsMatthew Heon2021-01-14
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements support for mounting and unmounting volumes backed by volume plugins. Support for actually retrieving plugins requires a pull request to land in containers.conf and then that to be vendored, and as such is not yet ready. Given this, this code is only compile tested. However, the code for everything past retrieving the plugin has been written - there is support for creating, removing, mounting, and unmounting volumes, which should allow full functionality once the c/common PR is merged. A major change is the signature of the MountPoint function for volumes, which now, by necessity, returns an error. Named volumes managed by a plugin do not have a mountpoint we control; instead, it is managed entirely by the plugin. As such, we need to cache the path in the DB, and calls to retrieve it now need to access the DB (and may fail as such). Notably absent is support for SELinux relabelling and chowning these volumes. Given that we don't manage the mountpoint for these volumes, I am extremely reluctant to try and modify it - we could easily break the plugin trying to chown or relabel it. Also, we had no less than *5* separate implementations of inspecting a volume floating around in pkg/infra/abi and pkg/api/handlers/libpod. And none of them used volume.Inspect(), the only correct way of inspecting volumes. Remove them all and consolidate to using the correct way. Compat API is likely still doing things the wrong way, but that is an issue for another day. Fixes #4304 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Reduce general binding binary sizebaude2021-01-13
| | | | | | | | when using the bindings to *only* make a connection, the binary was rough 28MB. This PR reduces it down to 11. There is more work to do but it will come in a secondary PR. Signed-off-by: baude <bbaude@redhat.com>
* Restore compatible API for prune endpointsJhon Honce2021-01-07
| | | | | | | | | | | * Restore correct API endpoint payloads including reclaimed space numbers * Include tests for API prune endpoints * Clean up function signatures with unused parameters * Update swagger for /networks/prune Fixes #8891 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Merge pull request #8831 from bblenard/issue-8658-system-prune-reclaimed-spaceOpenShift Merge Robot2021-01-05
|\ | | | | Rework pruning to report reclaimed space
| * 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>
* | Compat api containers/json add support for filtersPaul Holzinger2021-01-01
| | | | | | | | | | | | Fixes #8860 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | Expose Height/Width fields to decoderJhon Honce2020-12-30
|/ | | | | | Fixes #7102 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Consolidate filter logic to pkg subdirectoryBaron Lenardson2020-12-24
| | | | | | | Per the conversation on pull/8724 I am consolidating filter logic and helper functions under the pkg/domain/filters dir. Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
* SpellingJosh Soref2020-12-22
| | | | Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* remote copyValentin Rothberg2020-12-18
| | | | | | | | | | | | | | Implement `podman-remote cp` and break out the logic from the previously added `pkg/copy` into it's basic building blocks and move them up into the `ContainerEngine` interface and `cmd/podman`. The `--pause` and `--extract` flags are now deprecated and turned into nops. Note that this commit is vendoring a non-release version of Buildah to pull in updates to the copier package. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Merge pull request #8752 from baude/bindings3volumesOpenShift Merge Robot2020-12-17
|\ | | | | misc bindings to podman v3
| * misc bindings to podman v3baude2020-12-17
| | | | | | | | | | | | | | manifest, system, info, volumes, play, and generate bindings are updated to always have binding options. Signed-off-by: baude <bbaude@redhat.com>
* | Docker compat API - /images/search returns wrong structure (#7857)Milivoje Legenovic2020-12-17
|/ | | | Signed-off-by: Milivoje Legenovic <m.legenovic@gmail.com>
* Clean up temporary file.Matej Vasek2020-12-15
| | | | Signed-off-by: Matej Vasek <mvasek@redhat.com>
* Merge pull request #8696 from Luap99/podman-events-untilOpenShift Merge Robot2020-12-14
|\ | | | | podman events allow future time for --until
| * podman events allow future time for --untilPaul Holzinger2020-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The podman events aren't read until the given timestamp if the timestamp is in the future. It just reads all events until now and exits afterwards. This does not make sense and does not match docker. The correct behavior is to read all events until the given time is reached. This fixes a bug where the wrong event log file path was used when running first time with a new storage location. Fixes #8694 This also fixes the events api endpoint which only exited when an error occurred. Otherwise it just hung after reading all events. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | Merge pull request #8689 from bblenard/issue-8672-volume-pruneOpenShift Merge Robot2020-12-14
|\ \ | | | | | | Add volume prune --filter support
| * | Add volume prune --filter supportBaron Lenardson2020-12-12
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds support for the `--filter` / `?filters` arguments on the `podman volume prune` subcommand. * Adds ParseFilterArgumentsIntoFilters helper for consistent Filter string slice handling * Adds `--filter` support to podman volume prune cli * Adds `?filters...` support to podman volume prune api * Updates apiv2 / e2e tests Closes #8672 Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
* | Merge pull request #8690 from zhangguanzhang/apiv2-wrong-ImgNameOpenShift Merge Robot2020-12-11
|\ \ | | | | | | Fix Wrong img name used when creating a container from an image which had multi names
| * | Fix Wrong image tag is used when creating a container from an image with ↵zhangguanzhang2020-12-11
| | | | | | | | | | | | | | | | | | multiple tags Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
* | | Fix some network compat api problemsPaul Holzinger2020-12-11
| |/ |/| | | | | | | | | | | | | | | | | | | Network create could panic when used with a json body like this: `{"Name":"net","IPAM":{"Config":[]}}` The network scope for list and inspect should not be empty. It can be swarm, global or local. We only support local networks so hardcode this field to local. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | Merge pull request #8653 from rhatdan/buildahOpenShift Merge Robot2020-12-09
|\ \ | | | | | | Honor the --layers flag
| * | Honor the --layers flagDaniel J Walsh2020-12-09
| |/ | | | | | | | | | | | | | | | | Currently the --layers flag set by the user is ignored, and only the BUILDAH_LAYERS environment variable being set is observed. Fixes: https://github.com/containers/podman/issues/8643 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | pkg/copy: introduce a CopierValentin Rothberg2020-12-09
| | | | | | | | | | | | | | Introduce a `Copier` object to separate the copy-rule enforcement from copying. That allows for a better error reporting of the REST API. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | archive: move stat-header handling into copy packageValentin Rothberg2020-12-09
|/ | | | | | | | Move handling the stat header into `pkg/copy`. All copy-related should ideally be located in this package to increase locality and reduce scattering where possible. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Docker compat API - containers create ignores the nameMilivoje Legenovic2020-12-07
| | | | | | /containers/create compat endpoint does not set the name correctly (#7857) Signed-off-by: Milivoje Legenovic <m.legenovic@gmail.com>
* Jira RUN-1106 System handlers updatesJhon Honce2020-12-05
| | | | | | | | * Update tests to reflect system endpoints * First implementation of compat /system/df, only fields that are populated by libpod are set Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Jira RUN-1106 Volumes handlers updatesJhon Honce2020-12-04
| | | | | | * Add tests to verify required fields in responses Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Merge pull request #8601 from jwhonce/jira/RUN-1106-networksOpenShift Merge Robot2020-12-04
|\ | | | | Jira RUN-1106 Network handlers updates
| * Jira RUN-1106 Network handlers updatesJhon Honce2020-12-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add network API tests * Update network create endpoint to return ID not Name Audit: - GET /networks ListNetworks - GET /networks/{id} InspectNetwork - DELETE /networks/{id} RemoveNetwork - POST /networks/create CreateNetwork - POST /networks/prune 405 not implemented Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | Merge pull request #8570 from vrothberg/run-950OpenShift Merge Robot2020-12-04
|\ \ | |/ |/| rewrite container copy
| * rewrite podman-cpValentin Rothberg2020-12-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a new `pkg/copy` to centralize all container-copy related code. * The new code is based on Buildah's `copier` package. * The compat `/archive` endpoints use the new `copy` package. * Update docs and an several new tests. * Includes many fixes, most notably, the look-up of volumes and mounts. Breaking changes: * Podman is now expecting that container-destination paths exist. Before, Podman created the paths if needed. Docker does not do that and I believe Podman should not either as it's a recipe for masking errors. These errors may be user induced (e.g., a path typo), or internal typos (e.g., when the destination may be a mistakenly unmounted volume). Let's keep the magic low for such a security sensitive feature. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>