summaryrefslogtreecommitdiff
path: root/pkg/api
Commit message (Collapse)AuthorAge
* 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>
* Remove 1 sec delayJhon Honce2020-02-25
| | | | | | | | | * Stop closing net.Listener() twice on interrupt * Do not report error if closing server twice Fixes #5311 Signed-off-by: Jhon Honce <jhonce@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>
* search endpoint failure correctionBrent Baude2020-02-21
| | | | | | | | when returning an invalid search, a return was omitted triggering a null on the consumer end. Fixes: #5228 Signed-off-by: Brent Baude <bbaude@redhat.com>
* Merge pull request #5236 from marusak/filter_by_idOpenShift Merge Robot2020-02-21
|\ | | | | apiv2: Image filtering and fixup docs
| * apiv2: Fixup /containers/json filters documentationMatej Marusak2020-02-17
| | | | | | | | | | | | | | Mention what is the input format plus put literals into quotation marks for better readability (plus it seems that some tags were not rendered). Signed-off-by: Matej Marusak <mmarusak@redhat.com>
| * apiv2: Enable filtering images by IDMatej Marusak2020-02-17
| | | | | | | | | | | | | | It is more practical for API usage and also it is more in sync how filtering of containers works. Signed-off-by: Matej Marusak <mmarusak@redhat.com>
* | Merge pull request #5178 from marusak/expose_cpuOpenShift Merge Robot2020-02-21
|\ \ | | | | | | stats: Expose CPU usage in API
| * | stats: Expose CPU usage in APIMatej Marusak2020-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `stats.CPU` is a number representing CPU usage in percents. It is possible to calculate it from other exposed fields (once they are implemented correctly) but why to do it, when this is already calculated. This does not break API, it just adds another field. Signed-off-by: Matej Marusak <mmarusak@redhat.com>
* | | Merge pull request #5279 from edsantiago/swagger_fixesOpenShift Merge Robot2020-02-21
|\ \ \ | | | | | | | | Swagger: yet more fixes
| * | | Swagger: yet more fixesEd Santiago2020-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR #5204 added /libpod/containers/create but with the wrong swagger comment. Fix that. Also fix some other inconsistencies: missing 'libpod' prefix, missing 'Container' suffix, and change 'ContainerCreate' to 'CreateContainer'; all of these changes preserve consistency with both the invoked function as well as the overall naming conventions used in this module. Signed-off-by: Ed Santiago <santiago@redhat.com>
* | | | Merge pull request #5262 from schubter/signal-decodeOpenShift Merge Robot2020-02-21
|\ \ \ \ | |/ / / |/| | | APIv2: Fixed syscall.Signal not convertable by decoder
| * | | Fixed syscall.Signal not convertable by decoderAndreas Schubert2020-02-19
| | | | | | | | | | | | | | | | Signed-off-by: Andreas Schubert <schubter@gmail.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>
* | | | | Swagger: fix one incorrect commentEd Santiago2020-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR #5235 updated a bunch of entrypoints from {name} to {name:.*}, requiring matching changes to swagger comments. Looks like one got missed due to the manual nature of this work. Have I mentioned lately that manual maintenance of duplicate information is not a great idea? Discrepancy caught by my script, which I would really like to look into getting into CI, but is gating on #5238. (I would actually not like to get this script into CI, I would prefer to have the duplicate information be autogenerated from the function calls themselves, but I seem to have lost that battle) Signed-off-by: Ed Santiago <santiago@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>
* | | | | Merge pull request #5259 from schubter/apiv2-create-imageOpenShift Merge Robot2020-02-19
|\ \ \ \ \ | | | | | | | | | | | | APIv2: Fixed CreateImageFromImage not respecting supplied Tag parameter
| * | | | | Fixed CreateImageFromImage not respecting supplied Tag parameterAndreas Schubert2020-02-19
| | |/ / / | |/| | | | | | | | | | | | | Signed-off-by: Andreas Schubert <schubter@gmail.com>
* / | | | Fixed typo in KillContainerAndreas Schubert2020-02-19
|/ / / / | | | | | | | | | | | | Signed-off-by: Andreas Schubert <schubter@gmail.com>
* | | | Merge pull request #5247 from schubter/5242OpenShift Merge Robot2020-02-19
|\ \ \ \ | |/ / / |/| | | APIv2: fixes decoder issue
| * | | adds missing query struct tags and exports the fieldsAndreas Schubert2020-02-18
| | | | | | | | | | | | | | | | Signed-off-by: Andreas Schubert <schubter@gmail.com>
* | | | Swagger: fix inconsistencies (try #2)Ed Santiago2020-02-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As I've mentioned once or twice, hand-maintained swagger docs are evil. This commit attempts to fix: * Inconsistent methods (swagger says POST but code signature says GET) * Inconsistent capitalization * Typos ("Mounter", "pood") * Completely wrong paths (/inspect vs /json) * Missing .Method() registrations * Missing /libpod in some /volumes paths * Incorrect method declaration: /libpod/containers/.../kill was correct (POST) in swagger but wrong in the code itself (http.MethodGet). Correct the latter to MethodPost This is two hours' work, even with a script I have that tries to cross-check everything. Swagger docs should not be human-maintained. Signed-off-by: Ed Santiago <santiago@redhat.com>
* | | | Update mux rules to allow slashes in image namesJhon Honce2020-02-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | %2F escaping is also supported. Return better response on bad search terms Fixes #5229 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | | | Fix handler and systemd activation errorsJhon Honce2020-02-17
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On panic from handler: log warning and stack trace, report InternalServerError to client When using `podman system service` make determining the listening endpoint deterministic. // When determining _*THE*_ listening endpoint -- // 1) User input wins always // 2) systemd socket activation // 3) rootless honors XDG_RUNTIME_DIR // 4) if varlink -- adapter.DefaultVarlinkAddress // 5) lastly adapter.DefaultAPIAddress Fixes #5150 Fixes #5151 Signed-off-by: Jhon Honce <jhonce@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>
* | | Merge pull request #5214 from baude/apiv2loglibpodOpenShift Merge Robot2020-02-14
|\ \ \ | |/ / |/| | apiv2 libpod container logs
| * | 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>
* | | Merge pull request #5216 from baude/bindingstestcacheOpenShift Merge Robot2020-02-14
|\ \ \ | | | | | | | | add caching for binding tests
| * | | 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 pkg/signalValentin Rothberg2020-02-14
|/ / | | | | | | | | | | | | | | | | Add pkg/signal to deal with parts of signal processing and translating signals from string to numeric representations. The code has been copied from docker/docker (and attributed with the copyright) but been reduced to only what libpod needs (on Linux). Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | Merge pull request #5190 from baude/apiv2cockpit3OpenShift Merge Robot2020-02-14
|\ \ | | | | | | filtering behavior correction
| * | 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 #5074 from jwhonce/wip/swagger_endpointOpenShift Merge Robot2020-02-14
|\ \ \ | |_|/ |/| | Add /swagger/ endpoint to serve swagger yaml to clients
| * | Add /swagger/ endpoint to serve swagger yaml to clientsJhon Honce2020-02-04
| | | | | | | | | | | | | | | | | | The provided yaml file will describe the current Podman REST API. Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | | Merge pull request #5172 from giuseppe/api-fix-cpu-statsOpenShift Merge Robot2020-02-13
|\ \ \ | |_|/ |/| | api: fix the CPU stats reported
| * | stats: add SystemUsageGiuseppe Scrivano2020-02-12
| | | | | | | | | | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
| * | api: fix the CPU stats reportedGiuseppe Scrivano2020-02-11
| | | | | | | | | | | | Signed-off-by: Giuseppe Scrivano <gscrivan@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>
* | | | Merge pull request #5175 from baude/apiv2eventsOpenShift Merge Robot2020-02-12
|\ \ \ \ | | | | | | | | | | apiv2 stream events
| * | | | apiv2 stream eventsBrent Baude2020-02-11
| |/ / / | | | | | | | | | | | | | | | | | | | | the events endpoint should be stream-based. it also needed to be registered to answer and not produce 404s. Signed-off-by: Brent Baude <bbaude@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}