Commit Graph

1641 Commits

Author SHA1 Message Date
Mikhail Dmitrichenko
3ba76de619 api: avoid sizing logs channel from tail
The compat logs handler uses the tail query parameter both to select how
many log lines should be returned and as the capacity of the internal log
channel.

Only the former is part of the API semantics. The channel capacity should
not depend on a user-controlled value: negative values can produce an
invalid channel size, while very large values can cause excessive
allocation before any logs are read.

Use a small fixed-size buffer instead.

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko00@bk.ru>
2026-06-26 10:31:13 +03:00
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
Brent Baude
1479c7d6b6 Merge pull request #29017 from Luap99/readthedocs
build the swagger.yml on readthedocs
2026-06-23 13:45:12 -05:00
Matt Heon
9a11be879d Merge pull request #28696 from inknos/fix-quadlet-file-ordering-in-tar
quadlet API: fix tar install when non-quadlet file sorts first
2026-06-23 14:08:46 -04:00
Paul Holzinger
aef1dfad28 update version in swagger.yml
We did not do breaking API changes but it seems confusing to have the
latest docs open and it still says API v5.0.0.

And while at it update the logo link.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-23 19:11:11 +02:00
Šimon Brauner
010e7ce556 Handle uninstantiated template quadlets
Fixes: https://github.com/containers/podman/issues/26960

Signed-off-by: Šimon Brauner <sbrauner@redhat.com>
2026-06-23 14:34:20 +02:00
Paul Holzinger
4ae189843b Merge pull request #28637 from ValentinTorassa/manifest-push-retry-options
Add --retry support to manifest push
2026-06-23 12:00:03 +02:00
KyounghoonJang
9e38f86993 feat: add --ignore flag to network rm
Add `--ignore` to `podman network rm` so removing a missing
network returns success instead of exit code 1.

Keep existing error behavior for networks in use and other failures.

This commit message was translated from Korean to English using an LLM.

Fixes: #28363
Signed-off-by: KyounghoonJang <matkimchi_@naver.com>
2026-06-23 10:52:47 +09:00
Valen Torassa
72349937e3 Add --retry support to podman manifest push
This patch adds retry plumbing for podman manifest push.

CLI flags added: --retry and --retry-delay
Flags are read into ImagePushOptions and passed through the local ABI path
Remote clients and REST API now respect retry settings (retry / retryDelay)
retry-delay is parsed with time.ParseDuration
Defaults fall back to containers.conf when the flags are not set
Updated manpages, Swagger comments, and e2e tests to validate retry behavior

Fixes: #28590

Signed-off-by: Valen Torassa <valentintorassacolombero@gmail.com>
2026-06-22 15:49:27 -03:00
Paul Holzinger
eb3c0f4c1a Merge pull request #28957 from shuaiyuanxx/exec-honor-console-size
exec: honor ConsoleSize so the terminal is sized at creation
2026-06-22 16:30:13 +02: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
Shuai Yuan
f5efef5043 exec: honor ConsoleSize so the terminal is sized at creation
The exec API accepts a ConsoleSize but it is dropped: the exec
pseudo-terminal is created at its default size and only corrected
afterwards by an asynchronous resize. A short-lived exec that reads its
window size at startup (e.g. `stty size`) can therefore observe the wrong
size, because the resize may arrive after the process has already read it.
docker applies the size at creation.

Carry the requested ConsoleSize through ExecConfig and into the exec OCI
process spec (process.consoleSize) so the runtime sizes the terminal
before the process starts, removing the race. The local and remote CLIs
capture the caller's terminal size when -t is given and pass it through
ExecOptions, matching the behavior of `podman run`.

Re-enable the previously flaky `podman exec` case in the interactive
system test, which this change makes deterministic.

Signed-off-by: Shuai Yuan <shuaiyuanzju@gmail.com>
2026-06-22 10:36:10 +08:00
Matt Heon
df12c9806c Merge pull request #28214 from MayorFaj/feat/28189-volume-rename
feat: implement volume rename functionality
2026-06-18 14:47:35 -04:00
Jitka Halova
241167c156 Fix image search swagger to return array
Fixes: #23741

Signed-off-by: Jitka Halova <jobselko@redhat.com>
2026-06-18 14:57:19 +02: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
Jan Rodák
b294a92a25 Add reasons to all staticcheck suppressions
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-06-12 10:12:40 +02: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
7607c3ec82 fix: style
Signed-off-by: Matej Vašek <matejvasek@gmail.com>
2026-06-11 12:56:31 +02: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
Paul Holzinger
cefaa0ee44 Merge pull request #28712 from elezar/info-cdi-devices
info: report configured and discovered CDI devices
2026-06-10 14:34:35 +02:00
Paul Holzinger
486bacd3e4 Merge pull request #28335 from axel7083/refactor/quadlet-applications
refactor: podman quadlet sub-command
2026-06-05 17:55:51 +02:00
Giuseppe Scrivano
1a76d464fd cmd, commit: change --pause default to true
Pause the container by default during commit.  It is safer as it
avoids conflicts, and potentially security issues, when another
process is accessing the container rootfs.

Originally this was not done because it was a breaking change and
rootless containers weren't able to use the freezer cgroup controller.
Now that we support only cgroup v2, there is no gap anymore with
root (exotic configurations can still use --pause=false).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2026-06-03 07:28:22 +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
Evan Lezar
e740848eb9 info: report configured and discovered CDI devices
Add CDI information to podman info and podman system info.

The host info now includes the configured CDI spec directories and the
currently discovered CDI devices. The devices are resolved when the info
endpoint is called and there is no need to refresh these in the background.

Also map the same data into the Docker-compatible /info response as CDISpecDirs and DiscoveredDevices.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2026-06-01 21:45:41 +02:00
Tom Sweeney
8b1e46170b Adjust API calls for compression
Add the various compression API calls as created by @nalind in #28807

Signed-off-by: Tom Sweeney <tsweeney@redhat.com>
2026-05-29 09:10:50 -04: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
5b98ee331f Merge pull request #28641 from jiwahn/feat/container-annotation-filter
Feat/container annotation filter
2026-05-26 12:00:40 +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
Kir Kolyshkin
7f7b35356f Replace os.Is* error checks with errors.Is
Using os.Is{Exist,NotExist,Permission} checks is not recommended in the
new code (see official documentation). While using it in the existing
code is OK, it may still result in a subtle errors later (for a specific
example of that, see [1]).

Replace those with errors.Is.

Generated by:

	gofmt -r 'os.IsExist(a) -> errors.Is(a, os.ErrExist)' -w .
	gofmt -r 'os.IsNotExist(a) -> errors.Is(a, os.ErrNotExist)' -w .
	gofmt -r 'os.IsPermission(a) -> errors.Is(a, os.ErrPermission)' -w .
	goimports -w .
	git diff vendor test/tools/vendor | patch -p1 -R

[1]: https://github.com/opencontainers/runc/pull/5061
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-05-21 13:09:42 -07: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
Matt Van Horn
f2a51888f3 docs(api): drop trailing slash on podman.io/community contact URL
The swagger spec generated from pkg/api/server/doc.go sets the contact
URL to https://podman.io/community/. That URL now returns 404, while
https://podman.io/community (no trailing slash) returns 200 and is what
the live site links to from its own navigation. Issue #28298 reports
the link as broken at the top of the rendered API reference, which is
where ReDoc surfaces the contact field.

Drop the trailing slash so the contact link in the generated swagger
spec resolves.

Signed-off-by: Matt Van Horn <mvanhorn@gmail.com>
2026-05-19 02:48:35 -07:00
Jan Rodák
517070e750 Merge pull request #28673 from kyounghunJang/feat/add-volume-prune-dry-run
volume prune: add dry-run support
2026-05-18 19:26:18 +02:00
KyounghoonJang
3d899a8c25 volume prune: add dry-run support
Add a --dry-run option to show which volumes would be pruned without removing them.

Related: #27838
Signed-off-by: KyounghoonJang <matkimchi_@naver.com>
2026-05-16 19:03:34 +09: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
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
Jiwoo Ahn
ec583fa17f filters: add annotation filter for containers Fixes: #28562
Signed-off-by: Jiwoo Ahn <ikwydls1314@gmail.com>
2026-05-11 20:24:28 +09:00
Lokesh Mandvekar
89efbf1dce pkg/api/grpcpb: auto-format generated protobuf files
Update build.sh to run gofumpt on generated .pb.go files, and apply
formatting to existing generated files. This fixes gofumpt and inamedparam
lint errors on macOS CI and ensures future regenerations will be
automatically formatted.

Signed-off-by: Lokesh Mandvekar <lsm5@linux.com>
2026-05-07 13:30:23 -04: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
Brent Baude
2cc3be7332 RUN-4539: Change podman module paths
The podman module paths are moving from github.com/containers/podman to
go.podman.io/podman.  This will help with future mobility.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2026-04-22 14:02:25 -05:00
Brent Baude
2e6f29a2df RUN-4538: Fix buildah vendoring
This PR reflects the upstream change of moving the buildah module from
github.com/containers/buildah to go.podman.io/buildah.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2026-04-21 14:27:58 -05:00
Paul Holzinger
ff6fb6eb2d Merge pull request #28508 from jankaluza/configfile
trust: switch policy.json lookup to configfile
2026-04-21 12:04:43 +02:00
Matt Heon
98ca040cd7 Merge pull request #28536 from zhangguanzhang/fix-tmp
Clean up temporary file for CreateImageFromSrc
2026-04-20 18:19:20 -04:00
Jan Kaluza
cae4c40323 compat: limit err scope in CommitContainer.
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2026-04-20 15:11:34 +02:00
Jan Kaluza
54d61c2f02 trust: switch policy.json lookup to configfile
Use shared configfile instead of custom policy.json path handling.
This updates ocipull to rely on signature.DefaultPolicy(), removes
explicit SignaturePolicyPath, and replaces trust's custom default-policy
path logic with common configfile code.

Replace hidden `--policypath` with --signature-policy` and require
it for `trust set` command instead of path resolution based on
configfile.

For `trust get`, the `--signature-policy` is optional.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2026-04-20 15:11:22 +02: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
Paul Holzinger
34a4633d5f Merge pull request #28275 from mheon/ordered_networks
Move to deterministic network setup order
2026-04-20 12:33:13 +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
Jan Rodák
2fd0d2636c Merge pull request #28528 from inknos/pod-option-quadlet
Add Pod to quadlet list
2026-04-20 10:02:03 +02:00
zhangguanzhang
64f9059d2e Fixes: #28531 Clean up temporary file for CreateImageFromSrc
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2026-04-18 19:38:37 +08:00
Matthew Heon
efba9996f6 Implement --save-stages/--stage-labels for build
These are two new Buildah flags that we need to wire into Podman
(both local and remote) and document, with the interesting note
that one requires the other and a check needed to be added for
that.

Also: secret parsing was tightened up in Buildah, and was
breaking the remote build tests. Rewire it to use the new parser
Buildah made, which ends up simplifying the code considerably.
Tests are back to passing afterwards.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2026-04-17 10:00:32 -04:00