727 Commits

Author SHA1 Message Date
4347a62e08 Fix flake on failed podman-remote build
We have a race condition where podman build can fail
but still return an exit code of 0.  This PR ensures
that as soon as the build fails, the failed flag is set
eliminating the race.

Fixes: https://github.com/containers/podman/issues/10029

[NO TESTS NEEDED] Tests of failed builds are already in place, and
the elimination of the race should be enough.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-14 12:05:59 -04:00
9d74825c7e Reflect current state of prune implementation in docs
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-04-13 09:16:25 +02:00
59283322e7 [CI:DOCS] Correct status code for /pods/create
Swagger documentation reported that the API endpoint /pods/create
returned 200 while the as-built code returned 201. 201 is more
correct so documentation updated.

Tests already checked for 201 so no updated needed.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-04-12 09:33:51 -07:00
d41c33eb91 Update manifest API endpoints
* Add validation for manifest name
* Always return an array for manifests even if empty
* Add missing return in df handler when returning error. Caused an
  additional null to be written to client crashing python decoder.

When c/image is refactored to include manifests, manifest endpoints should
be revisited.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-04-09 11:00:06 -07:00
002180f02a Merge pull request #9971 from jwhonce/wip/df
Add missing return
2021-04-08 17:15:22 -04:00
3a03c2ec71 Merge pull request #9121 from tmds/swagger_remove_name_wildcards
[NO TESTS NEEDED] swagger: remove name wildcards
2021-04-08 13:04:23 -04:00
6cc0dc44ec Add missing return
libpod df handler missing a return after writing error to client. This
caused a null to be appended to JSON and crashed python decoder.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-04-08 08:59:37 -07:00
99e3111814 Merge pull request #9968 from pablofsf/fix-libpod-container-wait-docs
[CI:DOCS] Adjust libpod API Container Wait documentation to the code
2021-04-08 11:39:09 -04:00
9ba2e78cdc Merge pull request #9958 from jmguzik/limit-prune-filters-for-volumes
Volumes prune endpoint should use only prune filters
2021-04-07 18:55:23 -04:00
84907324fa Volumes prune endpoint should use only prune filters
Volumes endpoints for HTTP compat and libpod APIs allowed
usage of list HTTP endpoint filter funcs. Documentation in
case of compat API does not allow that. This commit aligns
code with the documentation and also ligns libpod with compat API.

Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-04-07 22:37:49 +02:00
5994377bd0 Merge pull request #9966 from jwhonce/wip/operation_id
[CI:DOCS] Update swagger definition of inspect manifest
2021-04-07 13:39:14 -04:00
6f6dad4048 Adjust libpod API Container Wait documentation to the code
Closes #9960

Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
2021-04-07 19:01:10 +02:00
9b35262ca2 [CI:DOCS] Update swagger definition of inspect manifest
* Changed reference in swagger to correct struture that was being
  returned.
* Added summary to ManifestAddLibpod to clean up generated web site
* Added serve target to Makefile, to aid in debugging generated
  web site

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-04-07 09:18:23 -07:00
71322d6c1f swagger: remove name wildcards
Signed-off-by: Tom Deseyn <tom.deseyn@gmail.com>
2021-04-07 15:21:44 +02:00
b68106703e Handle podman-remote --arch, --platform, --os
Podman remote should be able to handle remote specification of
arches.

Requires: https://github.com/containers/buildah/pull/3116

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-07 05:00:16 -06:00
d83f49ef6b Merge pull request #9754 from mheon/add_dep
Add --requires flag to podman run/create
2021-04-06 16:16:49 -04:00
6acd265306 Add --requires flag to podman run/create
Podman has, for a long time, had an internal concept of
dependency management, used mainly to ensure that pod infra
containers are started before any other container in the pod. We
also have the ability to recursively start these dependencies,
which we use to ensure that `podman start` on a container in a
pod will not fail because the infra container is stopped. We have
not, however, exposed these via the command line until now.

Add a `--requires` flag to `podman run` and `podman create` to
allow users to manually specify dependency containers. These
containers must be running before the container will start. Also,
make recursive starting with `podman start` default so we can
start these containers and their dependencies easily.

Fixes #9250

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-04-06 14:01:31 -04:00
51b23be38b [CI:DOCS] Polish swagger OpertionIDs
Renamed 4 IDs to be consistent with other endpoints.

Fixes #9951

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-04-06 10:10:54 -07:00
fa47b4f572 [CI:DOCS] Set all operation id to be compatibile
Libpod operation id's changed to better match compatibile id

Builds on https://github.com/containers/podman/pull/9123 and corrects
a duplicated ID.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-04-05 19:54:30 -07:00
5cbda3b789 Move operationIds to swagger:operation line
Signed-off-by: Tom Deseyn <tom.deseyn@gmail.com>
2021-04-05 13:57:13 -07:00
1214b1a38b swagger: add operationIds that match with docker
Signed-off-by: Tom Deseyn <tom.deseyn@gmail.com>
2021-04-05 13:56:51 -07:00
052732857a Fix missing podman-remote build options
Fix handling of SecurityOpts
   LabelOpts
   SeccompProfilePath
   ApparmorProfile

Fix Ulimits

Fixes: https://github.com/containers/podman/issues/9869

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-02 09:19:03 -04:00
23ee8b1df1 Merge pull request #9899 from kellen-dunham/fix_9698
Fix #9698 Updated reference to network
2021-04-01 23:47:46 +02:00
6c1f6bdccc Fixed podman-remote --network flag
Updated reference to network

[NO TESTS NEEDED]

Signed-off-by: Kellen Dunham <kellen@oneaib.com>
2021-03-31 09:55:45 -05:00
ab7c83392b Fix handling of remove --log-rusage param
Fixes: https://github.com/containers/podman/issues/9889

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-31 07:46:20 -04:00
bd07179e9c Merge pull request #9892 from jwhonce/wip/top
Trim white space from /top endpoint results
2021-03-30 21:29:26 +02:00
989c8e9785 Merge pull request #9863 from jmguzik/fix-prune-filter-funcs
Containers prune endpoint should use only prune filters
2021-03-30 20:51:00 +02:00
eef66973de Trim white space from /top endpoint results
Versions of the ps command have additional spaces between fields, this
manifests as the container asking to run "top" and API reporting "top "
as a process.

Endpoint and tests updated to check that "top" is reported.

There is no libpod specialized endpoint to update.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-03-30 10:42:06 -07:00
f7d82a1f30 Containers prune endpoint should use only prune filters
Containers endpoints for HTTP compad and libpod APIs allowed usage of list HTTP
endpoint filter funcs. Documentation in case of libpod and compat API does not allow that.
This commit aligns code with the documentation.

Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-30 10:19:22 +02:00
26b0ebd22f Merge pull request #9516 from rhatdan/shrink
[NO TESTS NEEDED] Shrink the size of podman bindings
2021-03-29 17:14:26 +00:00
58bf62f2d1 Merge pull request #9861 from TristanCacqueray/version-swagger
[CI:DOCS] swagger: update system version response body
2021-03-29 17:01:22 +00:00
48549ccc17 swagger: update system version response body
This change updates the swagger documentation of the
system version response body to match the actual
response.

Fixes: #9522
Signed-off-by: Tristan Cacqueray <tdecacqu@redhat.com>
2021-03-29 14:25:25 +00:00
127400880a [NO TESTS NEEDED] Shrink the size of podman-remote
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-29 09:49:45 -04:00
ac3499cc96 Merge pull request #9631 from rhatdan/pull
Fix podman build --pull-never
2021-03-29 13:41:42 +00:00
ccbe7e9456 Merge pull request #9829 from rhatdan/rmi
[NO TESTS NEEDED] Use same function podman-remote rmi as podman
2021-03-28 17:07:45 +00:00
7e4b13b946 Merge pull request #9467 from rhatdan/buildah
[NO TESTS NEEDED] Turn on podman-remote build --isolation
2021-03-28 11:00:45 +00:00
eb82c48cc5 [NO TESTS NEEDED] Use same function podman-remote rmi as podman
Make sure fixes that go into local podman commands also work in
podman-remote, by using the same function.

Since this is just a rewrite of existing code, existing tests should
handle it.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-28 06:56:44 -04:00
ec47312eeb Merge pull request #9822 from jmguzik/fix-pods-list-filters-http-api
Fix list pods filter handling in libpod api
2021-03-27 12:36:47 +00:00
4d51995377 Fix podman build --pull-never
Currently pull policy is set incorrectly when users set --pull-never.

Also pull-policy is not being translated correctly when using
podman-remote.

Fixes: #9573

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-27 05:33:30 -04:00
6e250c317c [NO TESTS NEEDED] Turn on podman-remote build --isolation
Currently podman only works with --isolation chroot.  This PR
fixes this by allowing the isolation mode to default to OCI and to
also allow users to pass the isolation mode into the containers.

The current tests for --isolation should cause this code to be tested.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-26 22:04:14 -04:00
85015a5e23 Fix list pods filter handling in libpod api
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-26 20:19:12 +01:00
dcabf6dd71 Remove resize race condition
Since podman-remote resize requests can come in at random times, this
generates a real potential for race conditions. We should only be
attempting to resize TTY on running containers, but the containers can
go from running to stopped at any time, and returning an error to the
caller is just causing noice.

This change will basically ignore requests to resize terminals if the
container is not running and return the caller to success.  All other
callers will still return failure.

Fixes: https://github.com/containers/podman/issues/9831

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-26 15:15:17 -04:00
429a655866 Fix filters in image http compat/libpod api endpoints
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-25 12:29:53 +01:00
4db4c65443 fixup
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-03-23 18:07:36 +01:00
aba3bbd059 fix: build endpoint for compat API
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-03-23 17:48:28 +01:00
d0bd775c02 Merge pull request #9773 from jmguzik/containers-prune-filters-http-api
Fix containers list/prune http api filter behaviour
2021-03-22 10:17:24 -07:00
907b34c46f Fix containers list/prune http api filter behaviour
The problem described in #9711 and followed by #9758 affects
containers as well. When user provides wrong filter input, error
message should occur, not fallback to full list/prune command.
This change fixes the issue. Additionally, there are error message
fixes for docker http api compat.

Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-20 22:56:01 +01:00
417f362811 Cleanup /libpod/images/load handler
* Remove orphaned code
* Add meaningful error from LoadImageFromSingleImageArchive() when
  heuristic fails to determine payload format
* Correct swagger to output correct types and headers

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-03-19 09:25:12 -07:00
aa2d6e6e6c Fix volumes and networks list/prune filters in http api
This is the continuation work started in #9711. It turns out
that list/prune commands for volumes in libpod/compat api have
very dangerous error handling when broken filter input is supplied.
Problem also affects network list/prune in libpod. This commit
unifies filter handling across libpod/compat api and adds sanity
apiv2 testcases.

Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-19 00:09:29 +01:00
629183bd7f Merge pull request #9710 from jmguzik/network-prune-filters-http-api
Network prune filters for http api (compat and libpod)
2021-03-18 06:32:29 -07:00