summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/libpod
Commit message (Collapse)AuthorAge
* 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>
* podman v2 image tag and untagBrent Baude2020-03-31
| | | | | | add the ability to tag and untag images in podmanv2 Signed-off-by: Brent Baude <bbaude@redhat.com>
* Merge pull request #5675 from vrothberg/v2-pullOpenShift Merge Robot2020-03-31
|\ | | | | podmanV2: implement pull
| * 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 api: implement pods top endpointValentin Rothberg2020-03-28
|/ | | | | | | Note that this commit does not add tests for the pod-top endpoint. They will be added in a later change. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Add support for containers.confDaniel J Walsh2020-03-27
| | | | | | | vendor in c/common config pkg for containers.conf Signed-off-by: Qi Wang qiwan@redhat.com Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #5632 from jwhonce/wip/imagesOpenShift Merge Robot2020-03-27
|\ | | | | V2 podman image prune
| * 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>
* | podmanv2 pod create using podspecgenBrent Baude2020-03-27
|/ | | | | | | | using the factory approach similar to container, we now create pods based on a pod spec generator. wired up the podmanv2 pod create command, podcreatewithspec binding, simple binding test, and apiv2 endpoint. also included some code refactoring as it introduced as easy circular import. Signed-off-by: Brent Baude <bbaude@redhat.com>
* podmanv2 pod subcommandsBrent Baude2020-03-26
| | | | | | add pod kill, pause, restart, rm, start, stop, and unpause Signed-off-by: Brent Baude <bbaude@redhat.com>
* Merge pull request #5604 from jwhonce/wip/imagesOpenShift Merge Robot2020-03-25
|\ | | | | V2 podman images/image list
| * V2 podman images/image listJhon Honce2020-03-24
| | | | | | | | | | | | | | | | | | | | * Updated entities to support flags/options * Updated bindings caused by entities changes * Removed handlers.ImageSummary in favor of entities.ImageSummary * Introduced StringSet() container object to simply error checking Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | podmanv2 volumesBrent Baude2020-03-24
|/ | | | | | add volume commands: create, inspect, ls, prune, and rm Signed-off-by: Brent Baude <bbaude@redhat.com>
* apiv2 container commit for libpodBrent Baude2020-03-23
| | | | | | | | add an endpoint for a libpod specific commit. add the abilility to define the format. also update documentation accordingly. Fixes: #5586 Signed-off-by: Brent Baude <bbaude@redhat.com>
* podmanv2 volume createBrent Baude2020-03-20
| | | | | | add volume create Signed-off-by: Brent Baude <bbaude@redhat.com>
* podmanv2 container exists|waitBrent Baude2020-03-20
| | | | | | enable container exists and wait for podmanv2 Signed-off-by: Brent Baude <bbaude@redhat.com>
* Merge pull request #5445 from sujil02/podFilter-newOpenShift Merge Robot2020-03-19
|\ | | | | Filter pods through pod list api
| * Filter pods through pod list apiSujil022020-03-17
| | | | | | | | | | | | | | Refactored current filter pods flow through the shared pod functions so filter pod functionalities can be shared between api and cmd. Signed-off-by: Sujil02 <sushah@redhat.com>
* | serve swagger when presentBrent Baude2020-03-18
|/ | | | | | register the swagger endpoint and add some error handling for when the swagger file does not exist Signed-off-by: Brent Baude <bbaude@redhat.com>
* Merge pull request #5449 from baude/manifestsOpenShift Merge Robot2020-03-17
|\ | | | | apiv2 addition of manifests
| * apiv2 addition of manifestsBrent Baude2020-03-16
| | | | | | | | | | | | | | | | add endpoints for create, add, remove, inspect, and push. this allows manifests to be managed through the restful interfaces. also added go-bindings and tests Signed-off-by: Brent Baude <bbaude@redhat.com>
* | add apiv2 healthcheck codeBrent Baude2020-03-13
|/ | | | | | reworking binding and endpoint to actually work. added documentation in swagger for and various return code possibilities. add a good start on tests though we need some other container functions not yet implemented for that. Signed-off-by: Brent Baude <bbaude@redhat.com>
* Update start stop api to use pod status function.Sujil022020-03-10
| | | | | | | Update the strat and stop api to validate pod status based on status functions rather than iterating over all the containers in the pod. (Addressing the TO-DO) Signed-off-by: Sujil02 <sushah@redhat.com>
* Refactor handler packagesJhon Honce2020-03-10
| | | | | | | To help with packaging, the handlers in pkg/api/handlers are now found in pkg/api/handler/compat. Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Fix spelling mistakes in code found by codespellDaniel J Walsh2020-03-07
| | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* rework apiv2 wait endpoint|bindingBrent Baude2020-02-28
| | | | | | | | added the ability to wait on a condition (stopped, running, paused...) for a container. if a condition is not provided, wait will default to the stopped condition which uses the original wait code paths. if the condition is stopped, the container exit code will be returned. also, correct a mux issue we discovered. Signed-off-by: Brent Baude <bbaude@redhat.com>
* binding tests for volumesBrent Baude2020-02-27
| | | | | | | | add binding tests for volumes: inspect(get), create, remove, prune, and list implement filters ability for volumes 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>
* Merge pull request #5251 from sujil02/pod-testOpenShift Merge Robot2020-02-20
|\ | | | | Add test to validate the pod bindings api
| * 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>
* | apiv2 container create using specgenBrent Baude2020-02-19
|/ | | | | | this uses the specgen structure to create containers rather than the outdated createconfig. right now, only the apiv2 create is wired up. eventually the cli will also have to be done. Signed-off-by: Brent Baude <bbaude@redhat.com>
* Refactor image tree for API usageSascha Grunert2020-02-17
| | | | Signed-off-by: Sascha Grunert <sgrunert@suse.com>
* Merge pull request #5217 from mheon/rework_label_parsingOpenShift Merge Robot2020-02-15
|\ | | | | Rework label parsing
| * Rework label parsingMatthew Heon2020-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We attempted to share all logic for parsing labels and environment variables, which on the surface makes lots of sense (both are formatted key=value so parsing logic should be identical) but has begun to fall apart now that we have added additional logic to environment variable handling. Environment variables that are unset, for example, are looked up against environment variables set for the process. We don't want this for labels, so we have to split parsing logic. Fixes #3854 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* | apiv2 libpod container logsBrent Baude2020-02-14
|/ | | | | | wire up containers logs for libpod side of the house, same as compat. Signed-off-by: Brent Baude <bbaude@redhat.com>
* filtering behavior correctionBrent Baude2020-02-12
| | | | | | when filtering containers, if a status= is provided as an input filter, then we should override the all to always be true. Signed-off-by: Brent Baude <bbaude@redhat.com>
* Merge pull request #5171 from baude/apiv2cockpit2OpenShift Merge Robot2020-02-12
|\ | | | | Fix container filters
| * Fix container filtersBrent Baude2020-02-11
| | | | | | | | | | | | container filters were being double encoded (maybe triple) which resulted in the wrong encoding representation of filters being sent by the go-bindings. Also, on the server side, Filter needed to be changed to Filter to decode properly. Finally, due to the changed return type of List Containers, the go bindings return values needed to be changed. Signed-off-by: Brent Baude <bbaude@redhat.com>
* | api: pull: fix reference parsingValentin Rothberg2020-02-12
| | | | | | | | Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | HTTP 304 (NotModified) is not an error!Ed Santiago2020-02-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even after #5169, my test logs kept showing: ERRO[0004] unable to write json: "http: request method or response status code does not allow body" Cause: overly-helpful code trying to treat condition as an error and include a diagnostic message. This is forbidden per rfc2616. This PR fixes the faulty response, as well as three others found via: $ ack 'Error.*NotMod' (4 hits total) $ ack 'Error.*NoCont' (no hits) Signed-off-by: Ed Santiago <santiago@redhat.com>
* | Merge pull request #5169 from edsantiago/apiv2_pod_status_codesOpenShift Merge Robot2020-02-11
|\ \ | | | | | | API v2: pods: fix two incorrect return codes
| * | API v2: pods: fix two incorrect return codesEd Santiago2020-02-11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | 1) /pods/<X>/exists - is documented to return 204, and that's the correct value, but until now it has been returning 200. 2) /pods/create - return 409 (conflict), not 500, when pod already exists Also: in WriteResponse(), if code is 204 (No Content) or 304 (Not Modified), emit the status code only but no content-type headers nor content. Signed-off-by: Ed Santiago <santiago@redhat.com>
* | Merge pull request #5083 from vrothberg/v2-libpod-image-endpointsOpenShift Merge Robot2020-02-11
|\ \ | |/ |/| v2 api: /libpod/images/{import,load,pull}
| * v2 api: /libpod/images/importValentin Rothberg2020-02-10
| | | | | | | | | | | | | | | | | | Implement the /libpod/images/import endpoint Tested manually with curl: curl -X POST --data-binary "@image.tar" --header "Content-Type: application/x-tar" Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
| * v2 api: /libpod/images/loadValentin Rothberg2020-02-10
| | | | | | | | | | | | | | | | | | Implement the /libpod/images/load endpoint. Tested manually with curl: curl -X POST --data-binary "@image.tar" --header "Content-Type: application/x-tar" Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
| * v2 api: /libpod/images/pullValentin Rothberg2020-02-10
| | | | | | | | | | | | | | | | | | | | Implement the /libpod/images/pull endpoint and correct the swagger docs. The reference parameter is mandatory and must either be a c/image/docker/reference or a reference to the "docker://" transport as the pull endpoint is meant to only support pulling images from a registry. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | Rewire ListContainers for APIv2 libpodBrent Baude2020-02-11
|/ | | | | | | | | | consumers of the api remarked how they would prefer a more strongly typed data structure from list containers oon the libpod side of things. for example, events should be consumable and consistent timestamps. also, for the sake of compatibility, it is helpful to have the json named atttributes for Id to not be ID. listcontainers on the libpod side no longer strongly uses the the ps cli to obtain information but we do benefit from turning on the ability to list the last X containers, something CLI does not have yet. we also flipped the bit on defaulting to truncated output in the return. thanks to the efforts of the cockpit team to help us here. Signed-off-by: Brent Baude <bbaude@redhat.com>
* swagger: v2: libpod/images/{import,load,pull}Valentin Rothberg2020-02-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: this commit is merely adding swagger documentation and the golang stubs and types for the proposed endpoints. The implementation will follow in separate individual changes in the future. The ultimate goal is to prevent the libpod API from exposing the rather complex /images/create endpoint from Docker and split it into easier to implement, use and comprehend endpoints with a more narrow focus. # Import Add the v2 swagger documentation for the libpod/images/import endpoint. Note that we have intend to have separate backend and not mix it up with load since import allows for specifying a URL instead of a local tarball. # Load Complete the v2 swagger documentation for the libpod/images/load endpoint. Note that we are accounting for future plans to be able to load multiple images from one oci/docker archive by returning an array of image-load responses. Also move the (incomplete) implementation of the generic endpoint to the corresponding package and create a stub for the libpod handler, which will be implemented once there's an agreement on the proposed API. # Pull Add the v2 swagger documentation for the libpod/images/pull endpoint. Similar to the load endpoint, we return an array since more than one image can be pulled when the `all-tags` parameter is set. Signed-off-by: Valentin Rothberg <rothberg@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 review corrections #3Brent Baude2020-01-25
| | | | | | The third pass of corrections for the APIv2. Signed-off-by: Brent Baude <bbaude@redhat.com>