539 Commits

Author SHA1 Message Date
b82f2962c3 compat: Add CgroupnsMode to POST /containers/create
Signed-off-by: Nicola Sella <nsella@redhat.com>
2025-05-15 15:31:16 +02:00
06ddffc81d Update dependency setuptools to ~=80.7.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-15 09:29:59 +00:00
59d9f1ea5d chore(deps): update dependency setuptools to ~=80.4.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-12 15:36:49 +00:00
5471f6e191 chore(deps): update dependency docker to v7
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-12 15:16:16 +00:00
857cfb9062 Merge pull request #25861 from cesargoncalves/main
update podman socket output to include also exposed ports
2025-05-06 19:10:36 +00:00
78065fd8c7 chore(deps): update dependency setuptools to ~=80.2.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-03 03:22:47 +00:00
b7f67badf3 chore(deps): update dependency setuptools to ~=80.1.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-30 18:14:59 +00:00
f6b91d7be0 inspect: Ignore character devices for IO limits
Cgroup block I/O limits cannot be applied to character devices.

Ignore character devices in the inspect output.

Update the API tests to use the null block device `/dev/nullb0` (if
available) instead of `/dev/zero` for testing I/O limits.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-04-30 16:21:38 +02:00
ce0bac24e5 Merge pull request #25986 from Honny1/fix-unlimited-ulimits
Fix handling of "r_limits" in Podman REST API /libpod/containers/create
2025-04-28 22:27:40 +00:00
2679304aa8 Merge pull request #25983 from matejvasek/fix-inherit-label
Fix: inheritlabels=true if query param absent
2025-04-28 16:02:48 +00:00
e66ff395b7 Fix handling of "r_limits" in Podman REST API /libpod/containers/create
The JSON decoder correctly cannot decode (overflow) negative values (e.g., `-1`) for fields of type `uint64`, as `-1` is used to represent `max` in `POSIXRlimit`. To handle this, we use `tmpSpecGenerator` to decode the request body. The `tmpSpecGenerator` replaces the `POSIXRlimit` type with a `tmpRlimit` type that uses the `json.Number` type for decoding values. The `tmpRlimit` is then converted into the `POSIXRlimit` type and assigned to the `SpecGenerator`.

This approach ensures compatibility with the Podman CLI and remote API, which already handle `-1` by casting it to `uint64` (`uint64(-1)` equals `MaxUint64`) to signify `max`.

Fixes: https://issues.redhat.com/browse/RUN-2859
Fixes: https://github.com/containers/podman/issues/24886

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-04-28 15:02:19 +02:00
42cee9d977 Merge pull request #25946 from ninja-quokka/docker_compat_force_image_remove
bug: Correct Docker compat REST API image delete endpoint
2025-04-28 11:03:41 +00:00
7819879776 chore(deps): update dependency setuptools to v80
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-27 17:44:15 +00:00
6e7de438cc bug: Correct Docker compat REST API image delete endpoint
The Docker `-XDELETE image/$name?force=true` endpoint only removes
containers using an image if they are in a non running state.

In Podman, when forcefully removing images we also forcefully delete
containers using the image including running containers.

This patch changes the Docker image force delete compat API to act like the
Docker API while maintaining commands like `podman rmi -f $imagename`

It also corrects the API return code returned when an image is requested
to be deleted with running containers using it.

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

Signed-off-by: Lewis Roy <lewis@redhat.com>
2025-04-27 20:51:11 +10:00
a969dbd73e update podman socket output to include also exposed ports
Fixes https://github.com/containers/podman/issues/25851

Co-authored-by: Brent Baude <bbaude@redhat.com>
Signed-off-by: Cesar Goncalves <mail@cesargoncalves.com>
2025-04-27 11:11:28 +01:00
4268c61dd0 Added tests for inheritlabel fix
Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2025-04-25 19:29:18 +02:00
49b6faea09 chore(deps): update dependency setuptools to v79
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-20 16:01:15 +00:00
3cbb718049 Fix compat API in rootless mode ignores ulimits
Fixes: https://github.com/containers/podman/issues/25881

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-04-17 16:11:34 +02:00
0b1d3a963d chore(deps): update dependency setuptools to v78
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-31 16:35:29 +00:00
0ca539c3ab chore(deps): update dependency setuptools to v77
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-20 17:05:33 +00:00
829cc591df chore(deps): update dependency setuptools to ~=76.1.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-18 11:22:57 +00:00
dd4f67fd72 chore(deps): update dependency setuptools to v76
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-15 12:58:42 +00:00
d1d8f3334f Merge pull request #25520 from Honny1/fix-hc-inf-log
Fix HealthCheck log destination, count, and size defaults
2025-03-13 18:59:34 +00:00
fff42ac232 Fix HealthCheck log destination, count, and size defaults
GoLang sets unset values to the default value of the type. This means that the destination of the log is an empty string and the count and size are set to 0. However, this means that size and count are unbounded, and this is not the default behavior.

Fixes: https://github.com/containers/podman/issues/25473
Fixes: https://issues.redhat.com/browse/RHEL-83262

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-03-12 21:27:00 +01:00
18abb18c9a chore(deps): update dependency setuptools to ~=75.9.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-12 19:03:18 +00:00
7bcd9c066e chore(deps): update dependency pytest to v8.3.5
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-03 14:49:43 +00:00
4dbbf264c7 Fix reporting summed image size for compat endpoint
Signed-off-by: Jakub Panek <me@panekj.dev>
2025-02-25 04:03:28 +00:00
5bada90190 test/apiv2: fix registry push flake
In our CI env we use a special registries.conf file
(test/registries.conf) to redirect some parts but it also defines:
[[registry]]
location="localhost:5000"
insecure=true

That means that port 5000 is trusted by default so the
/v1.40/images/localhost:5000/myrepo/push?tag=mytag test in 12-imagesMore
fails when the test registry uses port 5000.

Example failure:
not ok 360 [12-imagesMore] POST /v1.40/images/localhost:5000/myrepo/push?tag=mytag [-d {}] : status
 #  expected: 500
 #    actual: 200
 #  response: {"status":"The push refers to repository [localhost:5000/myrepo:mytag]"}
 {"status":"mytag: digest: sha256:d40f8191d6dae366339e318d1004258022f56bd8c649720a72060fad20019c9d size: 758"}

To avoid using port 5000 simply start at 5001.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-02-10 13:40:29 +01:00
14cd6ff1d2 chore(deps): update dependency pytest to v8.3.4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-28 14:32:40 +00:00
9403c3d98d Merge pull request #24678 from rhatdan/manifest
Add podman manifest rm --ignore
2025-01-27 14:52:05 +00:00
5522def65a do not set the CreateCommand for API users
This should be set only by podman as it is used for the podman generate
systemd --new command. For the api it was set to the system service
command which is simply pointless. It must be empty in these cases.

Fixes #25026

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-01-22 19:13:08 +01:00
5181becfde Add podman manifest rm --ignore
When removing manifests, users should be allowed to ignore
ones that no longer exists.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2025-01-22 11:43:47 -05:00
805e78c2aa Set network ID if available during container inspect
Fixes #24910

Signed-off-by: Florian Apolloner <florian@apolloner.eu>
2025-01-20 15:55:26 +01:00
ba24512959 chore(deps): update dependency setuptools to ~=75.8.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-08 21:35:30 +00:00
b23349d3bd chore(deps): update dependency setuptools to ~=75.7.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-07 14:02:54 +00:00
2f31a61cce Fix device limitations in podman-remote update on remote systems
Fixes: https://issues.redhat.com/browse/RUN-2381

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2024-12-09 17:35:56 +01:00
3096681ce3 chore(deps): update dependency setuptools to ~=75.6.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-20 20:27:53 +00:00
590fcafc2b chore(deps): update dependency setuptools to ~=75.5.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-13 12:01:33 +00:00
ca7703643b chore(deps): update dependency setuptools to ~=75.4.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-11 19:10:38 +00:00
e6d987882e API: container logs flush status code
API clients expect the status code quickly otherwise they can time out.
If we do not flush we may not write the header immediately and only when
futher logs are send.

Fixes #23712

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-01 18:54:13 +01:00
768ad8653a rework event code to improve API errors
One of the problems with the Events() API was that you had to call it in
a new goroutine. This meant the the error returned by it had to be read
back via a second channel. This cuased other bugs in the past but here
the biggest problem is that basic errors such as invalid since/until
options were not directly returned to the caller.
It meant in the API we were not able to write http code 200 quickly
because we always waited for the first event or error from the
channels. This in turn made some clients not happy as they assume the
server hangs on time out if no such events are generated.

To fix this we resturcture the entire event flow. First we spawn the
goroutine inside the eventer Read() function so not all the callers have
to. Then we can return the basic error quickly without the goroutine.
The caller then checks the error like any normal function and the API
can use this one to decide which status code to return.
Second we now return errors/event in one channel then the callers can
decide to ignore or log them which makes it a bit more clear.

Fixes c46884aa93 ("podman events: check for an error after we finish reading events")
Fixes #23712

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-01 18:54:13 +01:00
5f66277138 chore(deps): update dependency setuptools to ~=75.3.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-29 10:33:01 +00:00
f4227e887c Merge pull request #24275 from Luap99/wait-condition
libpod API: only return exit code without conditions
2024-10-22 10:53:12 +00:00
fe96c843bf APIv2 test fix: image history
I'm assuming this was buildah#5595: the COMMENT field moved around.
Deal with it, and add a few more checks while we're at it.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-16 10:15:19 -06:00
67e39c1ec5 pasta udp tests: new bytecheck helper
...for debugging #24147, because "md5sum mismatch" is not
the best way to troubleshoot bytestream differences.

socat is run on the container, so this requires building a
new testimage (20241011). Bump to new CI VMs[1] which include it.

 [1] https://github.com/containers/automation_images/pull/389

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-16 10:15:19 -06:00
927cb7624c Update dependency setuptools to ~=75.2.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-16 13:48:10 +00:00
768aaadca1 libpod API: only return exit code without conditions
The special handling to return the exit code after the container has
been removed should only be done if there are no special conditions
requested. If a user asked for running or nay other state returning the
exit code immediately with a success response is just wrong. We only
want to allow that so the remote client can fetch the exit code without
races.

Fixes b3829a2932 ("libpod API: make wait endpoint better against rm races")

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-15 18:31:36 +02:00
1dd90dbe20 feat(libpod): support kube play tar content-type (#24015)
feat(libpod): support kube play tar content-type

Signed-off-by: fixomatic-ctrl <180758136+fixomatic-ctrl@users.noreply.github.com>
2024-09-27 15:40:55 +02:00
e04668c8ca Match output of Compat Top API to Docker
We were only splitting on tabs, not spaces, so we returned just a
single line most of the time, not an array of the fields in the
output of `ps`. Unfortunately, some of these fields are allowed
to contain spaces themselves, which makes things complicated, but
we got lucky in that Docker took the simplest possible solution
and just assumed that only one field would contain spaces and it
would always be the last one, which is easy enough to duplicate
on our end.

Fixes #23981

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-09-17 11:34:22 -04:00
c436a9b658 chore(deps): update dependency setuptools to ~=75.1.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-16 13:17:21 +00:00