Commit graph

654 commits

Author SHA1 Message Date
Jan Rodák
c0fb461475
Merge pull request #29237 from gastoner/add-memavailable-support
Some checks are pending
ci / sys local root fedora-prior (push) Blocked by required conditions
ci / int local rootless fedora-prior (push) Blocked by required conditions
ci / sys local rootless fedora-prior (push) Blocked by required conditions
ci / int remote root fedora-prior (push) Blocked by required conditions
ci / sys remote root fedora-prior (push) Blocked by required conditions
ci / int local root fedora-rawhide (push) Blocked by required conditions
ci / sys local root fedora-rawhide (push) Blocked by required conditions
ci / int local rootless fedora-rawhide (push) Blocked by required conditions
ci / sys local rootless fedora-rawhide (push) Blocked by required conditions
ci / int remote root fedora-rawhide (push) Blocked by required conditions
ci / sys remote root fedora-rawhide (push) Blocked by required conditions
ci / apiv2 root fedora-current (push) Blocked by required conditions
ci / bindings root fedora-current (push) Blocked by required conditions
ci / compose_v2 root fedora-current (push) Blocked by required conditions
ci / docker_py root fedora-current (push) Blocked by required conditions
ci / unit root fedora-current (push) Blocked by required conditions
ci / apiv2 rootless fedora-current (push) Blocked by required conditions
ci / compose_v2 rootless fedora-current (push) Blocked by required conditions
ci / unit rootless fedora-current (push) Blocked by required conditions
ci / upgrade v5.3.1 root fedora-current (push) Blocked by required conditions
ci / upgrade v5.6.2 root fedora-current (push) Blocked by required conditions
ci / machine linux amd64 (push) Blocked by required conditions
ci / windows unit (push) Blocked by required conditions
ci / windows e2e (push) Blocked by required conditions
ci / windows machine hyperv (push) Blocked by required conditions
ci / windows machine wsl (push) Blocked by required conditions
ci / macos machine applehv (push) Blocked by required conditions
ci / macos machine libkrun (push) Blocked by required conditions
ci / Total Success (push) Blocked by required conditions
zizmor: GitHub Actions Security Analysis / Zizmor (push) Waiting to run
feat(info): add memAvailable to host info
2026-07-22 10:15:52 +02:00
Evzen Gasta
a19b696de1 feat(info): add memAvailable to host info
Expose MemAvailable alongside MemFree/MemTotal in `podman info` host
section, sourced from libpod/define/info.go's MemInfo.

Fixes: #29116 https://github.com/podman-container-tools/podman/issues/29116

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Evzen Gasta <evzen.ml@seznam.cz>

test(info): add coverage for host.memAvailable

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Evzen Gasta <evzen.ml@seznam.cz>
2026-07-22 08:41:59 +02:00
Jan Rodák
f2ad52c492
Merge pull request #28713 from simek-m/test/api-chunked-pullprogress
Some checks are pending
ci / sys local root fedora-prior (push) Blocked by required conditions
ci / int local rootless fedora-prior (push) Blocked by required conditions
ci / sys local rootless fedora-prior (push) Blocked by required conditions
ci / int remote root fedora-prior (push) Blocked by required conditions
ci / sys remote root fedora-prior (push) Blocked by required conditions
ci / int local root fedora-rawhide (push) Blocked by required conditions
ci / sys local root fedora-rawhide (push) Blocked by required conditions
ci / int local rootless fedora-rawhide (push) Blocked by required conditions
ci / sys local rootless fedora-rawhide (push) Blocked by required conditions
ci / int remote root fedora-rawhide (push) Blocked by required conditions
ci / sys remote root fedora-rawhide (push) Blocked by required conditions
ci / apiv2 root fedora-current (push) Blocked by required conditions
ci / bindings root fedora-current (push) Blocked by required conditions
ci / compose_v2 root fedora-current (push) Blocked by required conditions
ci / docker_py root fedora-current (push) Blocked by required conditions
ci / unit root fedora-current (push) Blocked by required conditions
ci / apiv2 rootless fedora-current (push) Blocked by required conditions
ci / compose_v2 rootless fedora-current (push) Blocked by required conditions
ci / unit rootless fedora-current (push) Blocked by required conditions
ci / upgrade v5.3.1 root fedora-current (push) Blocked by required conditions
ci / upgrade v5.6.2 root fedora-current (push) Blocked by required conditions
ci / machine linux amd64 (push) Blocked by required conditions
ci / windows unit (push) Blocked by required conditions
ci / windows e2e (push) Blocked by required conditions
ci / windows machine hyperv (push) Blocked by required conditions
ci / windows machine wsl (push) Blocked by required conditions
ci / macos machine applehv (push) Blocked by required conditions
ci / macos machine libkrun (push) Blocked by required conditions
ci / Total Success (push) Blocked by required conditions
zizmor: GitHub Actions Security Analysis / Zizmor (push) Waiting to run
test: Add API test for partial pull with pullProgress flag
2026-07-21 16:24:50 +02:00
Jan Rodák
bb4695870e
Merge pull request #28984 from stefan8/test/apiv2-manifest-create-images-query
test: add apiv2 coverage for the manifest-create images query param
2026-07-15 13:10:40 +02:00
renovate[bot]
6fa8cc3bd6
Update dependency docker to ~=7.2.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-13 17:13:06 +00:00
Marek Simek
612c7b71b4
api: Deprecate response fields from GET /containers/{id}/json
The Docker API 1.44 deprecates the fields HairpinMode, LinkLocalIPv6Address,
LinkLocalIPv6PrefixLen, SecondaryIPAddresses, SecondaryIPv6Addresses available in
NetworkSettings when calling GET /containers/{id}/json and will be removed in a future release.
You should instead look for the default network in NetworkSettings.Networks.

The fields are removed in 1.52. Version gate SecondaryIPAddresses, SecondaryIPv6Addresses
in the handler and update test. HairpinMode, LinkLocalIPv6Address, LinkLocalIPv6PrefixLen
are not returned by the compat endpoint as the response is serialized
to the moby/moby/api structure missing these fields.

Fixes: https://redhat.atlassian.net/browse/RUN-3323

Signed-off-by: Marek Simek <msimek@redhat.com>
2026-07-08 17:31:02 +02:00
Marek Simek
f4925bae8c
api: Deprecate is-automated filter and field in GET /images/search endpoint
The Docker API in version 1.44 deprecates the is_automated field for
the GET /images/search endpoint. The is_automated field has been deprecated
by Docker Hub's search API. Consequently, searching for is-automated=true
will yield no results.

The Docker API in version 1.44 deprecates the is_automated field
in the GET /images/search response and will always be set to false in the
future because Docker Hub is deprecating the is_automated field in its search API.

Return struct moby/api for the compat endpoint that matches the Docker
API response format and deprecates is_automated.

Update test_v2_0_0_image.py::ImageTestCase::test_search_compat
to verify returned format and fix subtests not being asserted (remove mp).

Fixes: https://redhat.atlassian.net/browse/RUN-3323

Signed-off-by: Marek Simek <msimek@redhat.com>
2026-07-08 17:31:02 +02:00
renovate[bot]
1e8f069cda
Update dependency setuptools to v83
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-04 16:42:12 +00:00
Marek Simek
af6d76481f
test/apiv2: Log correct port in start/stop_registry
Signed-off-by: Marek Simek <msimek@redhat.com>
2026-07-01 14:55:55 +02:00
Marek Simek
4cb705bfe9
test: Add API test for partial pull with pullProgress flag
Progress reporting in container-libs/image did not update
the progress channel for chunked layers. Add test that builds
a new image with chunked layers, pull it using the REST API
and verify that the progress stream contains events for
partial pulls too.

Depends-on: https://github.com/containers/container-libs/issues/469

Signed-off-by: Marek Simek <msimek@redhat.com>
2026-07-01 14:55:55 +02:00
Grzegorz Szczepanczyk
11daf5068a test/apiv2: cover the manifest-create images query param
The libpod manifest-create endpoint takes an "images" query parameter that
fills the new list at creation time, but 15-manifest.at never tested it.
Add cases that create a list with images= on both the v4
(/manifests/{name}, 201) and v3 (/manifests/create, 200) endpoints and
check the image ends up in the list.

Also drop the stale "required: true" from the images query parameter in the
swagger docs - the handler treats it as optional, and the existing create
tests (which omit it) already show that.

Fixes: #22258

Signed-off-by: Grzegorz Szczepanczyk <g.szczepanczyk@getprintbox.com>
2026-06-29 12:01:34 +02:00
Danish Prakash
7ab4b89c85
test/quadlet: pass Containerfile as part of a named application
PR #28860 requires non-quadlet files (e.g a Containerfile with no
recognized extension) to be passed as part of a named application.
Update tests added in #28696 to adhere to this requirment.

Signed-off-by: Danish Prakash <contact@danishpraka.sh>
2026-06-26 12:29:37 +05:30
Matt Heon
9a70aa562d
Merge pull request #28860 from l0rd/refactor/quadlet-applications-with-fix
Quadlet installation code refactoring
2026-06-25 13:45:29 -04:00
Nicola Sella
10cc702250
quadlet API: fix tar install when non-quadlet file sorts first
QuadletInstall expects the quadlet file to be first in the file list,
The API handler passes files in filepath.Walk order (lexicographic).
Install would fail if a file like "Containerfile" comes before the
quadlet file.

Signed-off-by: Nicola Sella <nsella@redhat.com>
2026-06-22 14:30:34 +02:00
renovate[bot]
cecb1731de
Update dependency pytest to v9.1.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-06-19 14:56:18 +00:00
Matt Heon
df12c9806c
Merge pull request #28214 from MayorFaj/feat/28189-volume-rename
Some checks are pending
ci / int local rootless fedora-prior (push) Blocked by required conditions
ci / sys local rootless fedora-prior (push) Blocked by required conditions
ci / int remote root fedora-prior (push) Blocked by required conditions
ci / sys remote root fedora-prior (push) Blocked by required conditions
ci / int local root fedora-rawhide (push) Blocked by required conditions
ci / sys local root fedora-rawhide (push) Blocked by required conditions
ci / int local rootless fedora-rawhide (push) Blocked by required conditions
ci / sys local rootless fedora-rawhide (push) Blocked by required conditions
ci / int remote root fedora-rawhide (push) Blocked by required conditions
ci / sys remote root fedora-rawhide (push) Blocked by required conditions
ci / apiv2 root fedora-current (push) Blocked by required conditions
ci / bindings root fedora-current (push) Blocked by required conditions
ci / compose_v2 root fedora-current (push) Blocked by required conditions
ci / docker_py root fedora-current (push) Blocked by required conditions
ci / unit root fedora-current (push) Blocked by required conditions
ci / apiv2 rootless fedora-current (push) Blocked by required conditions
ci / compose_v2 rootless fedora-current (push) Blocked by required conditions
ci / unit rootless fedora-current (push) Blocked by required conditions
ci / upgrade v5.3.1 root fedora-current (push) Blocked by required conditions
ci / upgrade v5.6.2 root fedora-current (push) Blocked by required conditions
ci / machine linux amd64 (push) Blocked by required conditions
ci / windows unit (push) Blocked by required conditions
ci / windows e2e (push) Blocked by required conditions
ci / windows machine hyperv (push) Blocked by required conditions
ci / windows machine wsl (push) Blocked by required conditions
ci / macos machine applehv (push) Blocked by required conditions
ci / macos machine libkrun (push) Blocked by required conditions
ci / Total Success (push) Blocked by required conditions
Publish swagger / Build and publish swagger.yaml (push) Waiting to run
zizmor: GitHub Actions Security Analysis / Zizmor (push) Waiting to run
feat: implement volume rename functionality
2026-06-18 14:47:35 -04:00
Mario Loriedo
d1e2692069 Quadlet installation code refactoring
- Cleanup the code to install quadlets
- Fix `podman quadlet install` output message (see https://github.com/podman-container-tools/podman/pull/28335#discussion_r3310372000)
- Update libpod quadlet endpoint documentation

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-06-16 12:28:58 +00:00
renovate[bot]
817c05240c
Update dependency pytest to v9.1.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-06-13 21:35:08 +00:00
MayorFaj
d01b7ae534 libpod: add volume rename support
Add a podman volume rename command, REST API endpoint, and bindings for renaming volumes.

The rename updates both the VolumeConfig and VolumeState tables in a single transaction and moves the volume directory on disk, rolling back if the transaction fails. Renaming an anonymous volume converts it to a named volume. Volumes that are in use, mounted, or backed by a volume plugin or the image driver cannot be renamed.

Fixes: #28189
Signed-off-by: MayorFaj <mayorfaj@gmail.com>
2026-06-11 21:56:15 +01:00
Matej Vašek
db70e73056
fix: compat API image push err meg propagation
When returning error http code (e.g. 4xx, 5xx) the body needs to contain
a JSON that has a key "message" in it,
we must not use jsonmessage.JSONMessage.

The JSON of shape jsonmessage.JSONMessage is used only when client
already received 200.

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
2026-06-11 12:56:29 +02:00
axel7083
496646f0da feat: update podman quadlet sub-command
Fixes: #28118
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2026-06-02 09:52:49 +00:00
Nicola Sella
e59b9dae8f
api/libpod: fix r_limits cleared on update
Returnin nil when input is empty, to skip rlimit replacement
when r_limits is not present in the request.

Fixes: https://issues.redhat.com/browse/RHEL-178653

Signed-off-by: Nicola Sella <nsella@redhat.com>
2026-05-27 13:32:31 +02:00
Jan Rodák
751f7c316d
Merge pull request #28714 from christopherbii/main
Fix Missing HostConfig field from API response
2026-05-26 10:26:46 +02:00
Christopher Bii
a53c10ced0
compat API: populate HostConfig in container list response
- Populate the Docker-compatible container summary HostConfig from the
  container inspect data
- Remove the unused ContainerCreateConfig wrapper from the compat
  handler
- Add APIv2 test

Signed-off-by: Christopher Bii <christopherbii@hyub.org>
2026-05-20 03:27:14 -04:00
Paul Holzinger
6f048e6500
inspect: do not show <nil> as gateway
When a network is created without gateway, i.e. --internal --disable-dns
then the gateway will be nil. But converting a nil ip to string produces
"<nil>" which is not what we want as we like an empty string there to
signal that the network has no gateway.

Fixes: #28705

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-05-18 20:47:52 +02:00
Matthew Heon
3ac6501fdd API Handlers should not error on empty request bodies
This is a Docker compatibility change discovered while working on
cases it is practically speaking required because there are
mandatory parameters in the body, but in those cases you do not
get a JSON decode error back, you get an error about the field
that needs to be set. I see no reason for us not to match this
convention; it doesn't break our existing bindings, but makes
using the API via curl or similar somewhat easier.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2026-05-13 16:33:40 -04:00
Paul Holzinger
82e7fc1440
Merge pull request #28692 from BackSlasher/compat-push-aux-trailer
api: emit aux trailer with manifest digest on image push
2026-05-13 14:47:20 +02:00
nitz
b571943fe4 api: emit aux trailer with manifest digest on image push
The Docker daemon emits a final `{"aux":{"Tag","Digest","Size"}}` JSON
object on the push event stream so clients can recover the registry-side
manifest digest without an extra registry round-trip.

Several Docker-API clients (e.g. the Pulumi and Terraform docker
providers) parse `aux.Digest` to populate their pushed-image outputs.
Without the trailer they either silently fall back to inspecting the
local image (whose digest does not always match what was pushed - see
containers/podman#14779) or emit "Push completed without reporting a
digest" warnings.

`pushReport.ManifestDigest` is already populated with the correct
on-the-wire digest from `manifest.Digest(pushedManifestBytes)`; this
change just wraps it into the same JSON shape Docker emits and adds an
apiv2 test asserting the trailer is present with Tag, Digest, and Size.

Signed-off-by: nitz <nitz.raz@gmail.com>
2026-05-13 13:23:16 +03:00
renovate[bot]
879594a2f9
chore(deps): update dependency requests to ~=2.34.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-11 20:00:35 +00:00
renovate[bot]
455367165c
Update dependency openapi-schema-validator to ~=0.9.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-27 18:58:39 +00:00
Matt Heon
cc2e2c94b8
Merge pull request #27929 from kairosci/fix/27786-health-field-containers-json
compat: Add Health field to /containers/json endpoint
2026-04-23 11:39:08 -04:00
Paul Holzinger
f2994dc695
move the python API tests to the cache registry
First remove the old v1 registries.conf the test was using and then make
it correctly load the cache registry for CI. This needs some minor test
fixes to make it work again.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-23 13:18:13 +02:00
Alessio Attilio
c4a4c7e117 API: Add Health field to compat ListContainers and restrict to v1.52+
Signed-off-by: Alessio Attilio <attilio.alessio@protonmail.com>
2026-04-23 08:39:43 +00:00
Jan Rodák
ecf493dea0
Fix Docker compat /wait hanging on fast-exiting containers
The Docker client (docker run) sends /wait then /start, but it only
sends /start after receiving the 200 OK response from /wait. Previously,
the event subscription for the "died" event was set up after the 200 was
sent, creating a window where a fast-exiting container (e.g. hello-world)
could emit its "died" event before the subscription was ready, causing
the client to hang forever.

Fix this by subscribing to "died" events before flushing the 200 status
code. This guarantees the event listener is ready before the client can
send /start, eliminating the race entirely.

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

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-04-20 15:01:42 +02:00
Jan Rodák
7534429ade
Merge pull request #28524 from Luap99/isolate
remove isolate option from docker compat API
2026-04-20 10:03:27 +02:00
Nicola Sella
d92cc360f1
Add Pod to quadlet list
Fixes: https://redhat.atlassian.net/browse/RUN-3835

Signed-off-by: Nicola Sella <nsella@redhat.com>
2026-04-17 13:42:16 +02:00
Paul Holzinger
41b785af5e
remove isolate option from docker compat API
With netavark v2 we start to default to strict isolation mode in
netavark[1] as such that already matches the docker behavior.

Therefore no longer hard code the isolate option in the compat api.

Podman v6 is requires netavark v2 for other changes already so we do
not need to worry about podman 6 + older netavark here.

[1] https://github.com/containers/netavark/pull/1438

Fixes: #27349

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-16 15:56:44 +02:00
Paul Holzinger
ea4a7f9b65
Merge pull request #28454 from aadi58002/main
fix(#28429): OCIRuntime field in SpecGenerator is ignored when called through HTTP Rest API
2026-04-15 14:33:24 +02:00
aadi58002
698c483b7c
fix: Ensure OCIRuntime Field is not ignored with HTTP Rest Api (#28454)
Signed-off-by: aadi58002 <aadi58002@gmail.com>
2026-04-14 13:48:11 +05:30
Jan Rodák
b3151b0ebf
Merge pull request #28460 from containers/renovate/pytest-9.x
chore(deps): update dependency pytest to v9.0.3
2026-04-13 15:22:03 +02:00
Nicola Sella
8dd7ac5756
Fix: set Swappiness when no mem limits
This hard codes -1 on inspect for Docker's API to return `null` and be compatible

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

Signed-off-by: Nicola Sella <nsella@redhat.com>
2026-04-08 15:10:11 +02:00
renovate[bot]
3ca47bf897
chore(deps): update dependency pytest to v9.0.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-07 21:58:31 +00:00
crawfordxx
fdf663b079 compat: map internal states to Docker equivalents in LibpodToContainer
The Docker compat /containers/json endpoint was leaking podman-internal
container states ("stopped", "stopping") that are not valid Docker API
states. Docker clients that strictly validate the State field against
the documented set ("created", "running", "paused", "restarting",
"exited", "removing", "dead") would fail with deserialization errors.

LibpodToContainerJSON already performs this mapping correctly:
- "stopped" → "exited"
- "stopping" → "running"

Apply the same remapping in LibpodToContainer using a switch statement
so the list endpoint behaves consistently with the inspect endpoint.

Add a test assertion to the compat /containers/json test to verify
that a stopped container is reported with State="exited".

Fixes #28359

Signed-off-by: crawfordxx <crawfordxx@users.noreply.github.com>
2026-03-29 12:04:46 +08:00
renovate[bot]
e50974edc9
chore(deps): update dependency requests to ~=2.33.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-25 17:59:42 +00:00
Jan Rodák
5260bd37b6
Merge pull request #28224 from simonbrauner/libpod-pull-progress
Extend libpod pull API to show pull progress
2026-03-24 10:43:32 +01:00
Jan Rodák
339acf880c
volume prune: match Docker default and add --all
Fixes: https://github.com/containers/podman/issues/24597
Fixes: https://issues.redhat.com/browse/RUN-4404

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-03-19 13:40:45 +01:00
Šimon Brauner
6f497d2437 Extend libpod pull API to show pull progress
Fixes: https://issues.redhat.com/browse/RUN-4362

Signed-off-by: Šimon Brauner <sbrauner@redhat.com>
2026-03-18 13:44:41 +01:00
Jan Rodák
acf6472f5b
Ignore operational EndpointSettings.IPAddress for static IPs in compat API
Docker treats EndpointSettings.IPAddress as operational/state, not desired create input.
Static address requests should come from IPAMConfig fields. Using both can duplicate
the same IPv4 request and trigger already allocated IPAM errors in compose scenarios.

Ref: moby/moby#46183 (daemon validation), docker/cli#4493 (CLI IPAMConfig), moby/moby#19001 (static IP feature).

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-03-16 13:48:41 +01:00
Lokesh Mandvekar
03f0b70b28
Merge pull request #28286 from com6056/fix-container-create-409
compat: return 409 Conflict when container name is already in use
2026-03-16 16:44:35 +05:30
Jordan Rodgers
7ecac4a65e compat: return 409 Conflict when container name is already in use
The Docker API spec defines HTTP 409 for POST /containers/create when
the requested name is already in use. The handler was returning 500 for
all errors from ContainerCreate, including ErrCtrExists.

This mismatch breaks buildx parallel builds on Podman: buildx checks
for a conflict response to safely converge multiple concurrent builders
onto the already-running BuildKit container. With 500 it treats the
conflict as a fatal error instead, causing all but the first parallel
build to fail.

The fix follows the same pattern already used in the rename handler,
which correctly returns 409 for ErrCtrExists. The swagger annotation
for this endpoint already documents the 409 response.

Signed-off-by: Jordan Rodgers <com6056@gmail.com>
2026-03-13 09:53:04 -07:00