summaryrefslogtreecommitdiff
path: root/pkg/api
Commit message (Collapse)AuthorAge
* libpod API: pull: fix channel raceValentin Rothberg2021-01-04
| | | | | | | | | Fix a race condition in the pull endpoint caused by buffered channels. Using buffered channels can lead to the context's cancel function to be executed prior to the items being read from the channel. Fixes: #8870 Signed-off-by: Valentin Rothberg <rothberg@redhat.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>
* Merge pull request #8787 from jsoref/spellingOpenShift Merge Robot2020-12-23
|\ | | | | Spelling
| * SpellingJosh Soref2020-12-22
| | | | | | | | Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* | add pod filter for psbaude2020-12-22
|/ | | | | | | | | adds the ability to filter containers based on the filter "pod". the value can be a pod name or its full or partial id. Fixes: #8512 Signed-off-by: baude <bbaude@redhat.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>
* Merge pull request #8715 from baude/bindings3imagesOpenShift Merge Robot2020-12-16
|\ | | | | Podman image bindings for 3.0
| * 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>
* | 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>
* | | Fix panic in libpod images exists endpointPaul Holzinger2020-12-10
| |/ |/| | | | | | | | | | | | | | | | | The libpod images exists endpoint panics when called with a non existing image and therefore returns 500 as status code instead of the expected 404. A test is added to ensure it is working. 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>
* generate kube on multiple containersbaude2020-12-07
| | | | | | | | | | add the ability to add multiple containers into a single k8s pod instead of just one. also fixed some bugs in the resulting yaml where an empty service description was being added on error causing the k8s validation to fail. Signed-off-by: baude <bbaude@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 #8494 from mlegenovic/masterOpenShift Merge Robot2020-12-04
|\ \ | | | | | | More docker compat API fixes
| * | More docker compat API fixesMilivoje Legenovic2020-12-04
| | | | | | | | | | | | | | | | | | Fixes wrong VirtualSize, ParentId, Architecture, Author, Os and OsVersion value Signed-off-by: Milivoje Legenovic <m.legenovic@gmail.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>
* | | Merge pull request #8584 from jwhonce/jira/RUN-1106-containersOpenShift Merge Robot2020-12-04
|\ \ \ | |_|/ |/| | Jira RUN-1106 Container handlers updates
| * | Jira RUN-1106 Container handlers updatesJhon Honce2020-12-03
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mostly audit and minor changes to nil from "" Audit: - GET /containers/json ListContainers - POST /containers/create CreateContainer - GET /containers/{id}/json GetContainer - GET /containers/{id}/top TopContainer - GET /containers/{id}/logs LogsFromContainer - GET /containers/{id}/changes Changes - GET /containers/{id}/export ExportContainer - GET /containers/{id}/stats StatsContainer - POST /containers/{id}/resize ResizeTTY - POST /containers/{id}/start StartContainer - POST /containers/{id}/stop StopContainer - POST /containers/{id}/restart RestartContainer - POST /containers/{id}/kill KillContainer - POST /containers/{id}/update 404 not supported - POST /containers/{id}/rename 404 not supported - POST /containers/{id}/pause PauseContainer - POST /containers/{id}/unpause UnpauseContainer - POST /containers/{id}/attach AttachContainer - GET /containers/{id}/attach/ws 404 not supported - POST /containers/{id}/wait WaitContainer - DELETE /containers/{id} RemoveContainer - HEAD /containers/{id}/archive Archive - GET /containers/{id}/archive Archive - PUT /containers/{id}/archive Archive - POST /containers/prune PruneContainers Images etc PR's will follow. Signed-off-by: Jhon Honce <jhonce@redhat.com>
* / Jira RUN-1106 Image handlers updatesJhon Honce2020-12-03
|/ | | | | | | | | | | | | | | | | | | | | | | * Audit and add tests for required fields. * Added issue for /images/load implementation Audit: - GET /images/json GetImages - POST /build BuildImage - POST /build/prune 404 not found - POST /images/create CreateImageFromImage/CreateImageFromSrc - GET /images/{name}/json GetImage - GET /images/{name}/history HistoryImage - POST /images/{name}/push PushImage - POST /images/{name}/tag TagImage - DELETE /images/{name} RemoveImage - POST /images/prune PruneImages - POST /commit CommitContainer - GET /images/{name}/get ExportImage - GET /images/get ExportImages - POST /images/load LoadImages See https://github.com/containers/podman/issues/8586 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Drop default log-level from error to warnDaniel J Walsh2020-12-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our users are missing certain warning messages that would make debugging issues with Podman easier. For example if you do a podman build with a Containerfile that contains the SHELL directive, the Derective is silently ignored. If you run with the log-level warn you get a warning message explainging what happened. $ podman build --no-cache -f /tmp/Containerfile1 /tmp/ STEP 1: FROM ubi8 STEP 2: SHELL ["/bin/bash", "-c"] STEP 3: COMMIT --> 7a207be102a 7a207be102aa8993eceb32802e6ceb9d2603ceed9dee0fee341df63e6300882e $ podman --log-level=warn build --no-cache -f /tmp/Containerfile1 /tmp/ STEP 1: FROM ubi8 STEP 2: SHELL ["/bin/bash", "-c"] STEP 3: COMMIT WARN[0000] SHELL is not supported for OCI image format, [/bin/bash -c] will be ignored. Must use `docker` format --> 7bd96fd25b9 7bd96fd25b9f755d8a045e31187e406cf889dcf3799357ec906e90767613e95f These messages will no longer be lost, when we default to WARNing level. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #8112 from QiWang19/load-optional-nameOpenShift Merge Robot2020-12-02
|\ | | | | Drop name argument from Load API
| * Do not pass name argument to Load APIQi Wang2020-12-02
| | | | | | | | | | | | | | Not pass the name argument to Load API. Specify in the document the usage of the optional argument is tagging an additional image. Close #7337 Signed-off-by: Qi Wang <qiwan@redhat.com>
* | Merge pull request #8552 from baude/buildtargetOpenShift Merge Robot2020-12-02
|\ \ | | | | | | target is not tag
| * | target is not tagbaude2020-12-02
| |/ | | | | | | | | | | remove mistaken use of target being used for tag Signed-off-by: baude <bbaude@redhat.com>
* / Add support for network idsPaul Holzinger2020-12-02
|/ | | | | | | | | | | | | | | | | | | The network ID is not stored. It is just the sha256 hash from the network name. There is a risk of a potential hash collision. However it's very unlikely and even if we hit this it will complain that more than network with this ID exists. The main benefit is that the compat api can have proper network ID support. Also this adds the support for `podman network ls --format "{{.ID}}"` and `--filter id=<ID>`. It also ensures that we can do network rm <ID> and network inspect <ID>. Since we use a hash this commit is backwards compatible even for already existing networks. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* Merge pull request #8505 from Luap99/network-labelsOpenShift Merge Robot2020-12-01
|\ | | | | podman network label support
| * podman network label supportPaul Holzinger2020-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add label support for podman network create. Use the `args` field in the cni config file to store the podman labels. Use `podman_labels` as key name and store the labels as map[string]string. For reference: https://github.com/containernetworking/cni/blob/master/CONVENTIONS.md#args-in-network-config https://github.com/containernetworking/cni/blob/spec-v0.4.0/SPEC.md#network-configuration Example snippet: ``` ... "args": { "podman_labels": { "key1":"value1", "key2":"value2" } } ... ``` Make podman network list support several filters. Supported filters are name, plugin, driver and label. Filters with different keys work exclusive. Several label filters work exclusive and the other filter keys are working inclusive. Also adjust the compat api to support labels in network create and list. Breaking changes: - podman network ls -f shortform is used for --filter instead --format This matches docker and other podman commands (container ps, volume ps) - libpod network list endpoint filter parameter is removed. Instead the filters paramter should be used as json encoded map[string][]string. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | Merge pull request #8126 from matejvasek/impl-apiv2-archiveOpenShift Merge Robot2020-12-01
|\ \ | | | | | | Implement containers/{id or name}/archive api
| * | not forcing unmountMatej Vasek2020-11-19
| | | | | | | | | | | | Signed-off-by: Matej Vasek <mvasek@redhat.com>
| * | add commentMatej Vasek2020-11-19
| | | | | | | | | | | | Signed-off-by: Matej Vasek <mvasek@redhat.com>