Commit Graph
8073 Commits
Author SHA1 Message Date
Paul Holzinger 803f524fff Merge pull request #29949 from ygalblum/allow-skip-require-mounts-for
quadlet: configure mount source dependencies
2026-10-12 18:38:01 +02:00
Matt Heon faf03944a3 Merge pull request #29839 from Garvity/quadlet-template-dropins
quadlet: discover template instances from drop-in directories
2026-10-10 13:51:22 -04:00
Ygal Blum 752d7f18e0 quadlet: configure mount source dependencies
Add [Quadlet] SetMountsDependency to select RequiresMountsFor, WantsMountsFor, or no generated dependency for user mount source paths.
Keep Requires as the default to preserve existing behavior and retain the required dependency on Podman's container storage directory.

Document the available values and the systemd version requirement for WantsMountsFor.
Add Quadlet integration fixtures covering Wants, Requires, None, and invalid values.

Fixes: #29946

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2026-10-09 13:08:36 -04:00
Sascha Grunert ac190fad18 libpod: report why the default OCI runtime failed to initialize
OCI runtime initialization errors are only logged at debug level, so
podman fails with a misleading `default OCI runtime "crun" not found`
even if crun exists but, for example, the exits directory below a
non-writable tmp dir could not be created. Keep the error of the default
runtime and return it when its initialization failed.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2026-10-09 07:07:11 +02:00
Danish Prakash 1246f0ab8e Merge pull request #27481 from Retr0-XD/label
feat(kube play): flag to specify resources (pods, secrets, volumes) labels #26450
2026-10-08 11:20:10 +05:30
Matt Heon f239badbab Merge pull request #29599 from Honny1/compat-cpu-stats
compat stats: fix system_cpu_usage, precpu_stats, one-shot CPU%, and docs
2026-10-07 13:48:27 -04:00
Jan Rodák fd25df818b compat stats: fix system_cpu_usage, precpu_stats, one-shot CPU%, and docs
- Read system_cpu_usage from /proc/stat (first 7 CPU fields, including idle) instead of cgroups.SystemCPUUsage(), matching Docker semantics.
- Use CPU values from GetContainerStats() instead of a second cgroup read to avoid a timing gap.
- Populate precpu_stats on stream=false with a 100 ms sampling pauseso the Docker CPU% formula returns a directionally correc snapshot. This only affects the compat per-container endpoint; podman-remote stats uses a separate libpod handler.
- Return cpu_stats.cpu as 0 for one-shot=true since the two samples are only milliseconds apart.
- Replace direct precpu copy instead of JSON marshal/unmarshal round-trip.
- Propagate errors via fmt.Errorf instead of logrus.Errorf, letting callers decide how to handle them. Parse errors in /proc/stat fields are hard errors instead of silently returning partial data.
- Document that --no-stream CPU% is a coarse ~100 ms snapshot; streaming gives 5-second interval readings.

Fixes: https://github.com/podman-container-tools/podman/issues/28761
Fixes: https://github.com/podman-container-tools/podman/issues/24730
Fixes: https://github.com/podman-container-tools/podman/issues/29912
Fixes: https://github.com/podman-container-tools/podman/issues/25709

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-10-07 13:19:53 +02:00
Jan Rodák 272bd9e5f7 Merge pull request #29867 from podman-container-tools/renovate/major-ci-vm-image
Update dependency podman-container-tools/automation to v20260930
2026-10-06 19:39:44 +02:00
Giuseppe Scrivano a973b14e38 Merge pull request #29899 from Monster-GM/fix/export-keep-id-ownership
fix: preserve ownership when exporting keep-id containers
2026-10-06 16:04:29 +02:00
Sakthi Harish faf93bb0ca feat(kube play): add --label flag to specify resource labels
Adds a -l/--label CLI flag to podman kube play and wires it through
the API, bindings, and ABI so user-provided labels are applied to pods,
PVCs, and secrets created from Kubernetes YAML.

Key features:
- Labels are merged with YAML labels (CLI takes precedence)
- Validation uses Kubernetes qualified-name rules (RFC1123 subdomains)
- Value validation enforces 63-char limit and charset rules
- Separate merge and validate functions (SOLID principle)
- Uses maps.Clone for cleaner merging

Fixes:
- Removed incorrect annotations size limit from label validation
- Refactored to call annotations.IsQualifiedName for key validation
- Added proper documentation for max key length enforcement

Closes #26450

Signed-off-by: Sakthi Harish <sakthi.harish@edgeverve.com>
2026-10-06 13:45:32 +00:00
Yanxin Li ca00c9edcc fix: preserve ownership when exporting keep-id containers
Rootless containers created with --userns=keep-id store host-mapped IDs
in their mounted root filesystem, so podman export showed host IDs in the
tar headers instead of the container ownership: files owned by container
UID/GID 1000 were exported as 0/0.

Pass the container's UID/GID mappings to the archive tar operation so the
tar headers are converted back to container IDs, like podman cp already
does. Containers without ID mappings pass an empty mapping, and the
archive code skips the conversion in that case.

Add an e2e regression test that follows the reproducer of the issue.

Fixes: #29856
Signed-off-by: Yanxin Li <462004436@qq.com>
2026-10-06 19:13:09 +08:00
Victor Irzak f41dc744b2 Omit unlimited pids limit for rootless cgroupfs
Rootless with the cgroupfs manager the pids controller is often not
delegated, as on WSL machines. The default path already skips the pids
limit there, but an explicit unlimited value (--pids-limit -1 or 0, the
PidsLimit=0 every Docker client sends, or pids.limit 0 on the libpod
API) still reached crun, which then failed with "controller `pids` is
not available".

A new cgroup has no pids limit anyway, so drop an unlimited limit in
that case. Finite limits are left as they are.

Fixes: https://github.com/podman-container-tools/podman/issues/29909
Signed-off-by: Victor Irzak <victor.irzak@zomp.com>
2026-10-06 06:10:13 -04:00
Matt Heon dd0fdbb78e Merge pull request #29636 from mandar1045/fix-volume-export-unmount
libpod: delay volume unmount in Export() until stream Close()
2026-10-05 15:32:24 -04:00
Yoonseo Han fa4ba39a29 libpod: defer volume plugin init when loading volumes from DB
Add e2e regression tests for refresh and lazy plugin use paths.

Fixes: #28110
Signed-off-by: Yoonseo Han <yooncer00@gmail.com>
2026-10-05 17:25:44 +09:00
Matt Heon 029d759171 Merge pull request #29637 from ROKUMATE/remove-dead-ps-pod-sort
podman ps: allow sorting by pod (finishes #13033's --sort half)
2026-10-02 15:24:11 -04:00
Jan Rodák 1c96b7b533 Merge pull request #29879 from podman-container-tools/renovate/github.com-moby-moby-client-0.x
Update module github.com/moby/moby/client to v0.6.1
2026-10-02 17:11:45 +02:00
Paul Holzinger 8fa7fb13ec test/python/docker: fix swagger check
The moby swagger.yaml was changed to quote HTTP status codes as string
as part of moby commit 79658025a2fd.
Thus fix the key lookup here to use a string as well.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-10-02 12:46:55 +02:00
Jan Rodák 8a7cbd9b15 Merge pull request #29842 from pooyanazad/fix-cp-volume-subpath-29840
libpod: honor volume subpath in cp
2026-10-02 12:46:09 +02:00
Kir Kolyshkin 9a2c84b130 test/e2e: fix podman run with noexec for ubuntu 26.04
Test case bind mounts host's /bin to /hostbin and tries to exec
/hostbin/ls, and expects a particular exit code.

It does not work on Ubuntu 26.04 because it ships with coreutils-rs
by default, in which:

	/bin/ls -> ../lib/cargo/bin/coreutils/ls

and so we get ENOENT instead of EPERM.

Fix by replacing ls with true. The funny thing is, it's also a symlink
on Ubuntu 26.04:

	/bin/true -> gnutrue

but it works since the destination is in the same directory.

(NOTE the whole test relies on the fact that the kernel checks
permissions first -- a dynamic binary from a different distro
won't be able to run anyway.)

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-01 11:29:30 -07:00
Garv Changrani 6330a1b4cf quadlet: discover template instances from drop-in directories
Quadlet currently requires an explicit instance file or symlink
before it reads that instance's drop-ins.

Discover instance-specific drop-in directories that match a loaded
template and create an in-memory copy of the template for each
instance. Apply the existing drop-in merging and service generation
logic to these copies. Explicit instance files and symlinks retain
priority.

An empty instance drop-in directory also creates an instance. It
inherits the template's settings and applicable drop-ins, including
[Install] settings that can create startup symlinks. Document this
behavior in the Quadlet man page.

Reject empty and dot instance names during discovery. Avoid extra
stat calls for ordinary directories while continuing to follow
symlinks to drop-in directories. Use Quadlet's existing debug logger.

Add table-driven unit tests with case-specific input files covering
drop-in precedence, instance isolation, empty directories, explicit
instances, separate search paths, supported unit types, and symlink
handling. Add an E2E test that checks generated services, inherited
settings, and startup symlinks without explicit instance files.

Fixes: #27636

Signed-off-by: Garv  Changrani <154041471+Garvity@users.noreply.github.com>
2026-10-01 07:15:10 +00:00
Mandar Joshi ccb4168157 libpod: delay volume unmount in Export() until stream Close()
Volume.Export() previously deferred v.unmount(false) inside the function body, which unmounted the volume before the caller could read the tar contents from the returned io.ReadCloser stream.

Introduce volumeExportReadCloser wrapper to delay v.unmount(false) until Close() is called on the stream. Also handle unmounting on tar creation failure and add a system test for exporting mounted volumes with multiple files.

Signed-off-by: Mandar Joshi <mandarjoshi1045@gmail.com>
2026-09-30 22:45:11 +05:30
pooyanazad bf3a78f22a libpod: honor volume subpath in cp
When copying files from created or stopped containers, podman cp resolves
named volumes on the host instead of using the container mount namespace.
The host-side resolution currently starts at the volume root and ignores the
mount's configured subpath, so cp can read a different file than the one
visible inside the container.

Apply the configured volume subpath before resolving the remaining container
path. Keep the path within the volume using secure path resolution and add
coverage for created, running, and stopped containers.

Fixes: #29840

Signed-off-by: pooyanazad <pooyan.azadparvar@gmail.com>
2026-09-30 18:19:10 +02:00
Paul Holzinger ba2f82df59 test: update quay.io/libpod/k8s-pause tag
We now just cache 3.5-nowin which is a manifest without windows images
that we never need and are super large otherwise.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-30 18:09:41 +02:00
Paul Holzinger a91da8a402 Merge pull request #29789 from nalind/update-buildah
Bump buildah to main
2026-09-30 17:50:07 +02:00
ROKUMATE 975833a33b podman ps: allow sorting by pod
Fixes: #13033
Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
2026-09-30 18:37:36 +05:30
Jan Rodák ac12be994e Merge pull request #29844 from Garvity/fix/ps-label-table-headings
ps: fix label lookup in container and pod table headings
2026-09-30 09:18:32 +02:00
Matt Heon c2f2b19ec8 Merge pull request #29852 from Luap99/multiple-pods-flake
test/e2e: fix flake in "multiple Pod replicas"
2026-09-29 18:01:02 -04:00
Paul Holzinger 30a0f83f39 Merge commit from fork
Revert "Enable 'podman run' for checkpoint images"
2026-09-29 14:49:04 +02:00
Garv Changrani d2b8502869 ps: fix label lookup in container and pod table headings
Table headings for `podman ps` and `podman pod ps` use a plain
`map[string]string`. A table template that calls `.Label` with an
argument fails while rendering the headings, before listing rows
are printed. For example: `podman ps --format 'table {{.Label "app"}}'`

Add a shared `PsHeader` type in `cmd/podman/common` with a `Label`
method that returns the requested label name as the column heading.
Use this type for both container and pod listings.

Add container unit tests and extend the existing container and pod
e2e tests to check label headings, label values, missing labels,
unlabeled objects, and `--noheading` output.

Fixes: #29831

Signed-off-by: Garv  Changrani <154041471+Garvity@users.noreply.github.com>
2026-09-29 11:29:57 +00:00
Paul Holzinger b2262db560 test/e2e: fix flake in "multiple Pod replicas"
GetPort() may return the same port twice, ensure we avoid the case to
not make the startup fail on a port conflict.

I saw this fail in CI once:
$ podman [options] kube play -q --multiple-pods --publish 5811:80,5811:80 /tmp/podman-e2e-759165132/subtest-4128675097/p/ptemp/kube.yaml
starting container b0aea9c7e396: rootlessport listen tcp :5811: bind: address already in use

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-29 13:12:32 +02:00
Paul Holzinger b71273be85 test/e2e: remove duplicated test logic
The kube down test does the exact same thing already so there is really
no need to duplicate this in the interest of test runtime.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-29 13:03:28 +02:00
Nalin Dahyabhai 61195895f3 Pass context.Context values down to newer buildah APIs
Buildah added some variants of APIs that should improve support for
cancellation, so let's use them.

Remove the import alias for its copier package in
cmd/podman/containers/cp.go and libpod/container_copy_common.go to be
more friendly to grep.

Update the "prune leftover build containers" test to intentionally leave
some behind during its setup instead of SIGKILLing a build process.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2026-09-29 06:05:20 -04:00
Rudraksha Singh 2ac2529bf7 compat: ignore dead and restarting status filters
Docker documents `dead` and `restarting` as valid values for the
`status` filter on `/containers/json`. Podman returns HTTP 500 when
either of them is used even though no Podman container can ever be in
those states.

Ignore these values in the compat API. If they are the only status
filters, return an empty list like Docker does. Invalid status values
still return an error.

The libpod API still rejects these values since they are Docker
specific. Update the libpod API docs to list the states Podman
actually supports.

Reference:
https://docs.docker.com/reference/api/engine/version/v1.51/#tag/Container/operation/ContainerList

Fixes: #28904
Signed-off-by: Rudraksha Singh <rudraksharss@gmail.com>
2026-09-29 00:21:19 +05:30
Matt Heon fa6cef22c2 Rework podman run checkpoint test
Needs to properly handle the error now that we've removed the
functionality.

Signed-off-by: Matt Heon <matthew.heon@pm.me>
2026-09-28 10:28:29 -04:00
Giuseppe Scrivano a1ce95d761 Merge pull request #29825 from Maniii97/fix/rootless-quadlet
quadlet: resolve symlinks to find drop-ins in target unit directory
2026-09-25 16:59:59 +02:00
Mani Shankar Jha 44e7c93c37 quadlet: search target directory of symlinked unit files for drop-ins
Fixes: #29821
Signed-off-by: Mani Shankar Jha <mani.jha@btr.group>
2026-09-24 19:17:48 +05:30
Matt Heon 5866b09c1f Merge pull request #29726 from r-vdp/compat-inline-seccomp
compat API: accept inline seccomp profiles
2026-09-24 09:01:54 -04:00
r-vdp 4ce2583ad7 compat API: accept inline seccomp profiles
Docker clients send the seccomp profile JSON itself in
HostConfig.SecurityOpt (the docker CLI reads the profile file
client-side and inlines it). The compat API treated the value as a path
to a profile file, so container create failed with "file name too
long". This breaks docker-compat tooling that passes seccomp profiles
through the socket, like Nextcloud AIO and forgejo-runner.

Add a SeccompProfile field to specgen for inline profile content,
next to the existing SeccompProfilePath, as requested in review of the
earlier PR that tried to fix this (#28985). The compat create handler
extracts inline profiles (values starting with "{") from SecurityOpt
and sets the new field. Path-based values and "unconfined" keep their
current meaning, and duplicate seccomp options resolve last-one-wins,
like docker.

Fixes: #27710

Signed-off-by: r-vdp <ramses@well-founded.dev>
2026-09-24 10:31:00 +02:00
Matt Heon 0fff70d9a0 Merge pull request #29827 from Honny1/fix-pids-max
Map pids-limit 0 to unlimited for runc
2026-09-23 17:38:09 -04:00
Danish Prakash 7b76d74080 Merge pull request #29818 from BartSimpson001/feature/29811-init-container-inspect
inspect: expose init container information
2026-09-24 00:37:34 +05:30
Jan Rodák 5fa0cb1090 Map pids-limit 0 to unlimited for runc
Docker documents HostConfig.PidsLimit 0 as unlimited, but runc sets
pids.max=1 for OCI pids.limit 0. Normalize 0 to -1 when building the
OCI spec so native CLI, compat API, and kube play behave consistently.

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

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-09-23 20:45:45 +02:00
THARUN 14243b7675 inspect: add IsInitCtr and InitContainerType fields
Add IsInitCtr and InitContainerType fields to container inspect output to distinguish init containers from regular containers.

Fixes: #29811
Signed-off-by: THARUN <tharunpoongavanam@gmail.com>
2026-09-23 22:32:45 +05:30
Jan Rodák 253e24f65e Merge pull request #28358 from aaron-ang/issue-17726-distribution-api
api: implement compat distribution inspect endpoint
2026-09-23 10:49:31 +02:00
Aaron Ang 3611b67505 api: implement compat distribution inspect endpoint
Fixes: #17726
Signed-off-by: Aaron Ang <aaron.angyd@gmail.com>
2026-09-22 21:14:45 -04:00
Matt Heon 8e3c572a85 Merge pull request #28579 from priyanshsao/inspect-tty-size
fix: return tty size in container_inspect.go
2026-09-22 11:30:58 -04:00
Matt Heon 41953b5742 Merge pull request #27631 from Mujib-Ahasan/extend-timeout-usec
fix: Container with Notify=healthy respect `HealthStartPeriod` larger than `TimeoutStartSec`.
2026-09-22 11:17:29 -04:00
Priyansh Sao 04250c6672 fix: implement console size for container inspect in linux
fix: return tty size in container_inspect_linux.go

This PR updates the console size field for containers with terminal enabled.

For cases where there is an issue with getting the size, suitable debug information is given, no update happens and default [0,0] is returned.

This implementation is only for Linux systems.

For FreeBSD, the console size is not implemented yet so, adds a todo for that.

Fixes: #28368

Signed-off-by: Priyansh Sao <saopriyansh06@gmail.com>

fix: add system test for podman inspect

Adds system test to verify console size is correctly updated, includes two cases:

When a tty is attached to the container - non-zero console size.

When a tty is not attached to the container - zero console size.

Fixes: #28368

Signed-off-by: Priyansh Sao <saopriyansh06@gmail.com>
2026-09-22 19:26:23 +05:30
Mujib Ahasan 92539ae033 fix: Container with Notify=healthy respect HealthStartPeriod larger than TimeoutStartSec
Fixes: #27290

Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
2026-09-22 14:11:21 +05:30
Marek Simek 9a32b4a31c compat: Omit empty Created field from GET /images/{id}/json
Docker API v1.44 omits the Created field (previously,
it was the zero value of 0001-01-01T00:00:00Z) if
the Created field is missing from the image config.

Omit it when zero from the compat API GET /images/{id}/json
(using `info.Created` instead of the previous `l.Created()`
that is set to `Now()` in storage/images.go when empty).

Add a test creating an image with the Created field missing.

Fixes: https://redhat.atlassian.net/browse/RUN-3317
Signed-off-by: Marek Simek <msimek@redhat.com>
2026-09-22 10:03:51 +02:00
Matt Heon 109bd7acd2 Merge pull request #29791 from evanpurkhiser/codex/auto-update-filter
auto-update: Add container filters
2026-09-21 15:01:10 -04:00