Commit Graph
7756 Commits
Author SHA1 Message Date
Jan Rodák c3b297331e Merge pull request #29767 from hihry/feat/AddSupporForOutputFlag
Add support for --output to podman build --remote
2026-11-05 11:57:57 +01:00
Matt Heon 34c95e4f35 Merge pull request #29887 from haneul-24/feat/kube-play-platform
Add --platform for kube play
2026-11-04 22:30:40 -05:00
Matt Heon a3af2edc34 Merge pull request #29942 from Garvity/fix/image-scp-working-directory
Fix image scp from inaccessible working directories
2026-11-04 18:25:47 -05:00
Matt Heon 8aa06825a6 Merge pull request #30109 from virzak/fix/update-pids-limit-unlimited
Revert rejected container updates and skip no-op pids updates
2026-11-04 18:22:55 -05:00
Victor Irzak aef1addf50 Skip unlimited pids update for rootless cgroupfs
Same failure #29910 fixed for create: with no pids limit to lift, there
is nothing to change, and the controller is often not delegated.

Signed-off-by: Victor Irzak <victor.irzak@zomp.com>
2026-11-04 04:08:56 -05:00
Boaz Shuster 7f7a7a3c62 compat/api: reject secret-create requests missing name and data
Fixes #30074

Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2026-11-01 10:55:05 +02:00
Sejal 342a2ebe73 add --platform for kube play
Fixes: #29177

Signed-off-by: Sejal <sej1306kook@gmail.com>
2026-10-31 09:08:39 +00:00
Himanshu Ravindra Iwanati 7735b15594 Add support for --output to podman build --remote
Fixes: #28342
Signed-off-by: Himanshu Ravindra Iwanati <work.himanshu.r.v@gmail.com>
2026-10-30 22:54:35 +05:30
Danish Prakash d727bf2fc6 Merge pull request #28983 from nomarek/start-pidfile
Add --pidfile flag to podman start
2026-10-30 22:23:05 +05:30
Bartek Mucha 76ac038f5f Honor runtime selection in the Docker-compatible container API
Signed-off-by: Bartek Mucha <muchzill4@gmail.com>
2026-10-30 10:27:56 +00:00
Paul Holzinger 721c004996 Merge pull request #29999 from twiesing/notifyproxy-barrier
pkg/systemd/notifyproxy: wait for a barrier before exiting
2026-10-29 17:20:33 +01:00
Matt Heon 1f3d414cd2 Merge pull request #29448 from Theodore-Liu/nightshift/podman-29223
Use ClientContextDirectory for prepareSecrets on Windows clients
2026-10-29 11:17:36 -04:00
Garv Changrani 4bbbca431b Fix image scp from inaccessible directories
Problem:
When image scp transfers an image between local users, the save, load,
and tag subprocesses inherit the caller's working directory. Running
the transfer from a directory such as /root can fail because the
destination user cannot access that directory during rootless
initialization.

Fix:
Use the caller's physical directory to preserve relative paths and
avoid inaccessible symlinks in PWD. Return working-directory lookup
errors.

If subprocess startup fails with a permission error, retry once from /.
Restrict the retry to fork/exec errors so a Podman command that has
already started is never executed a second time. For the retry, create
a fresh command with the same credentials, environment, and output
handling.

Tests:
Extend the transfer test to use an inaccessible directory.
Run its sudo checks from /.

Add coverage for relative and absolute configuration paths and
missing-image errors.

Fixes #24247

Signed-off-by: Garv  Changrani <154041471+Garvity@users.noreply.github.com>
2026-10-29 12:24:53 +00:00
Danish Prakash 4306018993 Merge pull request #29920 from Rajkaran-122/issue-29819-quadlet-template-dependency-clean
quadlet: fix rootless template dependency translation for rootful templates
2026-10-29 17:18:28 +05:30
Rajkaran Yadav 4861a957bb fix: handle templated Quadlet dependencies
Fix rootless Quadlet generator failure when a rootless templated unit
contains a dependency (e.g., Conflicts=) that points to a rootful
templated Quadlet unit.

The translateUnitDependencies function only looked up dependencies in
unitsInfoMap, which contains only units found in rootless directories.
When a rootless unit referenced a rootful template (e.g., test1@.container
in /etc/containers/systemd), the lookup failed with "unable to translate
dependency for %s".

This fix follows systemd's template dependency semantics: when a template
unit references another template unit, the instance name is propagated from
the source to the target. For example, test2@instance1.container with
Conflicts=test1@.container resolves to test1@instance1.service.

The implementation:
- Detects uninstantiated template dependencies (e.g., test1@.container)
- Extracts the instance name from the current unit if it's a template
- Generates the instance filename (e.g., test1@instance1.container)
- Checks if the generated instance exists in unitsInfoMap
- Returns an error if not found (no fallback to preserve typo detection)
- Does not propagate instance name for already-instantiated dependencies
- Does not propagate instance name when the source is not a template

This approach preserves the existing file-existence validation while
allowing template-to-instance resolution for symlinked rootful templates
in rootless directories.

Also adds regression tests for non-container resource types (volumes,
networks) to verify the fix works correctly for all Quadlet types.

Fixes: #29819

Signed-off-by: Rajkaran Yadav <yadavrajkaran854@gmail.com>
2026-10-29 14:18:33 +05:30
Boaz Shuster bf7b0b0b24 tunnel: don't ignore error in SecretList
Fixes: #30065
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2026-10-28 19:52:12 +02:00
94a8882f5f libpod: add next-exit, not-running and removed wait conditions
`podman wait --condition=exited` (and `=stopped`) returns immediately with
exit code 0 for a container that was created but never started. This
matches Docker's `not-running` semantics, but leaves no way to block until
the container has actually run and exited.

Move the Docker wait conditions from the compat API into libpod, so that
they are available to the CLI and the libpod REST API, and let the compat
handler use them instead of its own implementation:
* next-exit: wait for the next "died" event regardless of the current
  state and return its exit code. Like Docker, removal also ends the wait
* not-running: the same as exited
* removed: wait until the container has been removed and return its exit
  code, or 0 if it never ran

The docker compat handler uses the new `ready` callback in
`WaitForConditionWithInterval` to send its headers to keep the fix for #28514

Behavior changes of the compat API:
* not-running on a never-started container now always returns 0, before
  they could ping-pong between -1 and 0
* next-exit returns when the container is removed, instead of blocking
  forever, and fails if the event stream ends without a died event
* removed polls the container state at the wait interval

Fixes: #27423

Co-authored-by: Jan Rodák <hony.com@seznam.cz>
Co-authored-by: Tom Sweeney <tsweeney@redhat.com>
Signed-off-by: Dan Čermák <dcermak@suse.com>
Assisted-by: Claude Opus 5.5
Assisted-by: Gemini 4 Argon
2026-10-27 17:21:47 +01:00
Dan Čermák 24f21599f0 libpod API: return wait errors
ContainerWait() reports errors of the individual waits in the report and
not as its own error, which WaitContainerLibpod ignored. Wait failures then
result in a 200 instead of erroring out

Also do not write a second response after an internal server error

Signed-off-by: Dan Čermák <dcermak@suse.com>
Assisted-by: Claude Opus 5.5
2026-10-27 17:21:46 +01:00
Matt Heon 78719c065f Merge pull request #30045 from Honny1/speedup-get-version-api
compat: stop gathering full Info() for GET /version
2026-10-27 11:28:36 -04:00
Jan Rodák e03c617b73 compat: stop gathering full Info() for GET /version
Avoid slow distro package lookups for helpers not shown in the version response.

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

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-10-27 13:17:23 +01:00
Danish Prakash 83d9108ed4 Merge pull request #29632 from prabhat-kumar96/conmon-log-rotation-api
log: expose conmon log rotation options through REST API and CLI
2026-10-27 12:11:40 +05:30
Danish Prakash 39be679b54 Merge pull request #30012 from SebTardif/fix/kube-down-secret-error
kube: print secret removal errors on kube down
2026-10-27 08:10:30 +05:30
Sebastien Tardif d4338d14c6 kube: print secret removal errors on kube down
podman kube down and podman play kube --down kept the last secret
removal error, then printed it only when a pod removal had also
failed. PrintErrors already writes every earlier error and returns
the last one, so a single secret failure produced no error line.
A pod failure with every secret removed printed Error: %!s(<nil>).

Print that saved error when it is set. Pod stop, pod removal, and
volume removal reporting stay as they were. The command still
returns only volume removal errors. Those errors are printed and
not returned.

The remote client JSON-decodes SecretRmReport. json-iterator writes
Err as a string, and encoding/json rejected that string, so kube
down exited 125 before it could print the secret error. ID and Err
use omitempty, so a nil error stays off the wire. The helper type
is secretRmReportHelper. Marshal and unmarshal are covered the same
way as PruneReport.

The secret teardown e2e replaces secretsdata.json with a directory,
so the delete fails for root and for an unprivileged user. kube down
stays exit 0 and the error is on stderr. AfterEach deletes the test
root, so the data file is not restored.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
2026-10-26 10:14:17 -07:00
prabhat-kumar96 385f0905e9 log: expose conmon log rotation options through REST API and CLI
As of conmon 2.2.0, conmon supports log file rotation via --log-rotate
and --log-max-files. This commit exposes those options through Podman's
REST API, specgen model, CLI (--log-opt), and libpod container runtime
so that users managing containers through the API can configure conmon
log rotation settings.

New --log-opt keys accepted:
  max-file=<n>               Maximum number of rotated log backup files.
                             Setting this implicitly enables log rotation.
  log-rotate=true|false      Explicitly enable or disable log rotation.

Options flow:
  CLI / REST API
    -> specgenutil parses and validates new opts
    -> specgen.LogConfig.Options carries max-file and log-rotate
    -> generate.MakeContainerFromSpec calls WithLogMaxFiles/WithLogRotate
    -> libpod stores LogMaxFiles and LogRotate in ContainerConfig
    -> oci_conmon_common.go passes --log-max-files/--log-rotate to conmon

podman inspect now reflects rotation settings in HostConfig.LogConfig.Config.

Fixes: https://github.com/containers/podman/issues/29543
Signed-off-by: prabhat-kumar96 <prabhatmathur9927@gmail.com>
2026-10-24 15:44:16 +05:30
Srilal Sachintha f6104ee5f4 machine: remove stale API socket before starting the host proxy
Since gvisor-tap-vsock v0.9.0 (containers/gvisor-tap-vsock#718),
gvproxy and win-sshproxy no longer delete a leftover unix socket before
listening on it; they only remove it on a clean exit. When the proxy is
killed instead (host shutdown or restart, crash, SIGKILL), the API
socket is left behind and the next proxy fails to bind it:

- WSL: win-sshproxy exits and takes the named pipes with it, while
  `machine start` still reports success.
- Hyper-V, macOS and Linux: gvproxy exits, which also breaks SSH
  forwarding, so `machine start` fails (or hangs on macOS).

Remove the API socket in startNetworking, after cleanupStaleHostForwarder
has handled any orphaned proxy. On WSL a failed delete only warns, since
win-sshproxy serves only the API and SSH goes through wslrelay.

On macOS and Linux, `machine stop` also failed after gvproxy was killed
("looking up PID ...: process does not exist"); treat a missing gvproxy
as already stopped, as the Windows code does.

The "client connect to machine socket" e2e test now also kills the proxy
by the PID from its pid/tid file, restarts the machine and checks the API
again, and runs on Windows too.

Fixes: #29971
Signed-off-by: Srilal Sachintha <SrilalSachintha@Gmail.com>
2026-10-21 22:43:01 +05:30
Jan Rodák d4f12fff14 Merge pull request #29997 from ROKUMATE/machine-info-vmtype
podman machine info: report the current machine's vmtype
2026-10-21 18:10:44 +02:00
Matt Heon 534c5329ae Merge pull request #28741 from SebTardif/fix-remote-fd-leaks
Fix file descriptor leaks in remote import, save, and checkpoint operations
2026-10-21 11:09:45 -04:00
Tobias Wiesing 2132e0918b pkg/systemd/notifyproxy: wait for a barrier before exiting
systemd attributes a notification to a unit by the cgroup of its sender
when it reads the message. The podman process that sends READY for
--sdnotify=healthy exits right after sending it, and when systemd reads
the message only then, it is dropped and the unit runs into its start
timeout.

Add SendMessageWithBarrier, which sends BARRIER=1 with a pipe fd after
the message and waits up to five seconds until the receiver closes it,
as sd_notify_barrier(3) does. Use it where podman may exit after
notifying: MAINPID (and READY) after starting a container, READY once it
is healthy, and the fast path of kube play. A failed barrier is only
logged at debug level since the message itself was sent.

Also parse only the received control message in the proxy's listener.
It parsed the whole buffer, failed, and never closed the barrier fds.

The sdnotify system tests now receive on the notify socket with a new
podman-testing sd-notify-listen command instead of socat. socat keeps
the fds it receives, so every barrier ran into its timeout; the new
command closes them right away. BARRIER=1 is not logged.

Fixes: #29998
Signed-off-by: Tobias Wiesing <tobias@hueske.digital>
2026-10-21 15:29:10 +02:00
Paul Holzinger d40bf1e1ac Merge pull request #29990 from CodeWithAK28/manifest-annotate-os-features
pkg/domain: apply --os-features in manifest annotate
2026-10-21 13:17:24 +02:00
Anisha Khairnar 79a2995dab pkg/domain: apply --os-features in manifest annotate
Signed-off-by: Anisha Khairnar <anishakhairnar284@gmail.com>
2026-10-21 11:16:24 +05:30
Jan Rodák 85f068d88f Merge pull request #30011 from grey3228/fix/remote_secret_rm_inspect_error
tunnel: don't remove a secret after a failed inspect
2026-10-20 16:54:50 +02:00
Mikhail Dmitrichenko 4437a68164 tunnel: don't remove a secret after a failed inspect
The remote secret rm looks every secret up first and only special-cases
a 404 from the server.  Any other error response falls through to the
removal path with a nil inspect report, and podman-remote crashes on
secret.ID.  This is easy to hit: if the given name is not a secret name
but matches the start of more than one secret ID, the server answers
with a 500 "secret is ambiguous".

Report the error for that secret instead, like the local code does, and
don't try to remove it.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
2026-10-20 13:54:46 +03:00
Matt Heon 94e3baf965 Merge pull request #29331 from JJordan0C/fix/version-libpod-swagger-paths
Add versioned Libpod API paths to generated Swagger
2026-10-20 05:47:28 -04:00
Ashley Cui 1644490429 Merge pull request #29882 from Rajkaran-122/issue-29880-ssh-timeout
machine: timeout built-in SSH command checks
2026-10-19 15:00:58 -04:00
Matt Heon 27e4135866 Merge pull request #29888 from shounakpatil/status-negated-filter
ps: support negated status filter
2026-10-19 13:38:51 -04:00
Jan Rodák 6137c245f1 Merge pull request #29955 from sairex53/codex/issue-29711-skip-userns
quadlet: skip TestUnitDirs when user namespaces are unavailable
2026-10-19 19:16:27 +02:00
Rohit Kumawat 1a82536bc4 podman machine info: report the current machine's vmtype
Fixes: #29139
Signed-off-by: Rohit Kumawat <rohitkumawat0110@gmail.com>
2026-10-19 20:15:39 +05:30
JJordan0K 1ea76afdf0 Add versioned Libpod API paths to generated Swagger
Update the generated Swagger specification so that Libpod API paths include the required version prefix. Keep the unversioned ping endpoint unchanged, reuse the version path parameter, and add tests for the path rewriting logic.

Fixes: #15376
Signed-off-by: JJordan0K <69581081+JJordan0C@users.noreply.github.com>
2026-10-19 16:17:55 +02:00
Eduard Zateev ce7c649923 quadlet: skip unit dir test when userns is denied
Fixes: #29711

Signed-off-by: Eduard Zateev <hackerowskiy@gmail.com>
2026-10-19 13:30:03 +02:00
Sebastien Tardif 1d6b0e5b8c Fix file descriptor leaks in remote import, save, and checkpoint operations
Fix four file descriptor leaks:

1. tunnel/images.go Import: os.Open(opts.Source) never closed
2. tunnel/images.go Save: second os.Open for oci-dir/docker-dir never closed
3. bindings/checkpoint.go Restore: os.Open(importPath) never closed
4. container_internal_common.go: os.Create in checkpoint volume export
   loop not closed on five error paths

These are the same class of bug fixed in #28723 and #28724.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
2026-10-19 04:26:13 -07:00
Jan Rodák 3ddc24e13b Merge pull request #29965 from liujianqiang-niu/main
fix(rootless): preserve systemd socket activation fds on re-exec
2026-10-19 10:39:51 +02:00
Jianqiang Liu 7ac4011b5e fix(rootless): preserve systemd socket activation fds on re-exec
When podman.service is socket-activated at user login it races with the
other podman units to set up the rootless pause process.  If the
re-executed child loses the race for the pause PID file, podman falls
back to reexec_userns_join(), which forks again.

The parent of reexec_in_user_namespace() used to close the LISTEN_FDS
socket (fd 3) before this fallback, so the final child inherited a stale
fd 3 (the CLOEXEC user-namespace handle) and the journald datagram socket
then reused fd 3.  The API service tried to accept(2) on a datagram
socket and failed with "accept4: operation not supported", leaving
podman.service failed at boot while a manual restart worked.

Move the close out of reexec_in_user_namespace() into a new
close_systemd_activation_fds() helper that the parent calls only after the
pause PID race is resolved.  On the success path the fds are still closed
so they are not leaked for the lifetime of the child; on the race-lost
path they stay open so reexec_userns_join() can hand them to the final
child.

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

Signed-off-by: Jianqiang Liu <liujianqiang@uniontech.com>
2026-10-15 19:27:17 +08:00
Jan Rodák 711e684785 pkg/systemd: do not compile dbus code for remote or non-linux builds
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-10-14 15:01:46 +02:00
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
shounakpatil 6993625ac7 ps: support negated status filter
Allows 'status!=value' in container filters, matching the existing
'label!' handling and the negation syntax of 'podman image list'.
Also treats 'status!' as an explicit status filter in ps so that
non-running containers are considered without --all.

Fixes #21398

Signed-off-by: shounakpatil <shounakpatil77@gmail.com>
2026-10-09 22:59:12 +05:30
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
Jan Rodák f2f73eb68e Use gvproxy notify socket instead of polling for readiness
Fixes: https://redhat.atlassian.net/browse/RUN-4471

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-10-09 17:53:36 +02:00
Rajkaran Yadav 1e80ec74f5 machine: timeout built-in SSH command checks
Add a 30-second context timeout to the VM readiness SSH check in
conductVMReadinessCheck(). This prevents indefinite blocking when the SSH
server hangs (e.g., due to OpenSSH 10.2p1 interoperability issues).
LocalhostSSH and LocalhostSSHSilent remain uncapped to preserve indefinite
execution for legitimate long-running SSH commands like ansible-playbook
or Hyper-V client9p.

Add stale Starting-state recovery at the beginning of startLocked() to clear
mc.Starting=true when the provider reports the machine is Stopped or Running.
This recovers from hard process termination where deferred cleanup cannot execute.
The recovery only clears Starting when State() returns Stopped or Running,
preserving it for Starting, Unknown, and error cases to respect provider state
semantics.

Adds an E2E test that simulates persisted stale Starting=true state and
verifies that the next podman machine start recovers the state and starts
the machine successfully.

Fixes: #29880
Signed-off-by: Rajkaran Yadav <yadavrajkaran854@gmail.com>
2026-10-09 02:29:48 +05:30
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
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