podman/pkg/api/handlers/libpod
Jan Rodák 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
..
containers.go Add --env and --unsetenv to podman update. 2025-03-21 13:15:44 +01:00
containers_create.go Fix handling of "r_limits" in Podman REST API /libpod/containers/create 2025-04-28 15:02:19 +02:00
containers_stats.go set !remote build tags where needed 2024-08-19 11:41:28 +02:00
generate.go Remove containers/common/pkg/config from pkg/util 2024-09-06 07:45:04 -04:00
healthcheck.go Add stopped status for HealthCheck 2025-03-03 17:09:30 +01:00
images.go Add podman manifest rm --ignore 2025-01-22 11:43:47 -05:00
images_pull.go set !remote build tags where needed 2024-08-19 11:41:28 +02:00
images_push.go set !remote build tags where needed 2024-08-19 11:41:28 +02:00
info.go set !remote build tags where needed 2024-08-19 11:41:28 +02:00
kube.go Add --no-hostname option 2025-01-15 06:51:32 -05:00
kube_test.go feat(libpod): support kube play tar content-type (#24015) 2024-09-27 15:40:55 +02:00
manifests.go Add type and annotations to artifact add 2025-01-31 09:53:03 -06:00
networks.go set !remote build tags where needed 2024-08-19 11:41:28 +02:00
play.go set !remote build tags where needed 2024-08-19 11:41:28 +02:00
pods.go update golangci-lint to v2.1.1 2025-04-14 19:33:42 +02:00
secrets.go set !remote build tags where needed 2024-08-19 11:41:28 +02:00
swagger_spec.go set !remote build tags where needed 2024-08-19 11:41:28 +02:00
system.go Clean up after unexpectedly terminated build 2025-01-27 14:21:27 +01:00
volumes.go volume ls: fix race that caused it to fail 2024-11-06 12:28:52 +01:00