Commit Graph

7472 Commits

Author SHA1 Message Date
Paul Holzinger
0ead98d2d4 Merge pull request #29092 from ROKUMATE/feat-playkube-container-name
pkg/domain: include container name in kube play start errors
2026-07-03 13:25:18 +02:00
ROKUMATE
8748e6c9ac pkg/domain: include container name in kube play start errors
Fixes: #27196
Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
2026-07-03 15:07:41 +05:30
Brent Baude
9ac9834a50 Merge pull request #29100 from afbjorklund/machine-cache
Restore caching of the default machine image
2026-07-02 10:05:27 -05:00
Brent Baude
4d5435f47e Merge pull request #29103 from Luap99/wsl-config-mount
machine/wsl: fix config mount logic
2026-07-02 10:05:04 -05:00
Jan Rodák
e852389e55 Merge pull request #29071 from Luap99/scannererr
fix missing error checks for bufio.Scanner
2026-07-02 14:55:12 +02:00
Paul Holzinger
114bb1efa7 machine/wsl: fix config mount logic
The current systemd service to mount /etc/containers is not working
right. The Before=podman.socket causes a ordering conflict which causes
the socket to be disabled and thus all podman remote connections fail.

The problem is the unit is wanted by the default.target while the socket
is wanted by sockets.target which can be before the default.target is
triggered. That means that the Before= line cannot be fulfilled and
sometimes systemd thus seems to not start the socket. It is unclear to
me why this is racy as it is sometimes also works.

This was reported by Vladimir Lazar from the PD team, our CI did not
caught this as we use rootless machines by default and the problem only
happens for the rootful socket so we do not see connection failures.
To fix this add at least one rootful socket check.

We do however have a different CI flake that was also caused by the
incorrect mount dependencies. The mount could happen after sshd or other
programs run. So to fix this we must hook the podman-mnt-config.service
into the local-fs.target which runs much earlier and is used for all the
mounts.

Fixes: #29003

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-07-02 14:01:43 +02:00
Anders F Björklund
d4a1efbe9b Restore caching of the default machine image
It was removed, with the hardcoded image reference.

So cache was always off, even for the default image.

Fixes: #29090

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2026-07-01 18:09:21 +02:00
ROKUMATE
3d9e8fd2d3 pkg/domain: return an error instead of nil on remote event parse failure
In remote mode `podman events --format json` could print the literal "null"
instead of an event object. The remote client converts each event received
from the server with ConvertToLibpodEvent, which returned nil when it could
not parse the server result (an unknown status or type, or an invalid
containerExitCode). The tunnel forwarded that nil as an event with no error
set, so the CLI marshalled a nil event and printed "null".

Return a descriptive error from ConvertToLibpodEvent and send it on the event
channel, which the CLI already handles, instead of forwarding a nil event.

Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
2026-06-30 18:13:20 +05:30
Paul Holzinger
838fc24d3e machine: simplify ssh debug output logging
When the command output is logged we do not need an extra pipe and
scanner to read the output line by line, we can just log it directly via
a writer.

Now this of course does loose the line by line parsing of the scanner
but IMO this is better as it is simpler and less code to worry about.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-30 10:32:32 +02:00
Paul Holzinger
278068ef18 fix some missing scanner error checks
Found by scannererr:
https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/scannererr

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-30 10:32:32 +02:00
Paul Holzinger
4cbae8b6a7 Merge pull request #28991 from l0rd/fix-machine-start-signal-handling
Fix signal handling during machine start on macOS
2026-06-29 18:50:09 +02:00
Jan Rodák
5c8a6d5019 Merge pull request #29038 from shuaiyuanxx/fix-volume-prune-all-label-filters
Honor label filters for volume prune when all is set
2026-06-29 16:47:29 +02:00
Marek Simek
e353bab7f5 fix: Handle healthcheck log corruption gracefully
The healthcheck log could be corrupted if the
process was interrupted mid-write. It could
lead to Podman crashing.

Write the log files atomically and diferentiate
between corrupted log and different errors in
consumers of readFromFileHealthCheckLog().
Add a system test for a corrupted log file.
Change incorrect log permissions to 0o600.

Fixes: https://redhat.atlassian.net/browse/RHEL-178222
Signed-off-by: Marek Simek <msimek@redhat.com>
2026-06-29 13:03:47 +02:00
Paul Holzinger
a91d487db7 Merge pull request #29063 from l0rd/fix-machine-init-when-wsl-isnt-installed
Fix machine init when WSL isn't installed
2026-06-29 12:15:43 +02:00
Shuai Yuan
4586dc2c60 Honor label filters for volume prune when all is set
NormalizeVolumePruneFilters discarded every query filter when the "all"
pseudo-filter was set, deleting label/label!/until before they reached the
volume filter generator. As a result `podman volume prune --all --filter
label=foo` ignored the label and pruned every unused volume.

"all" only widens the prune scope from anonymous-only to all unused volumes;
it is orthogonal to the label filters, which must still select which of those
volumes are removed. Drop only the "all" key and keep the remaining filters so
they continue to apply.

NormalizeVolumePruneFilters is shared by the local (abi), remote (libpod API),
and Docker-compat prune paths, so all three were affected.

Signed-off-by: Shuai Yuan <shuaiyuanzju@gmail.com>
2026-06-29 17:51:27 +08:00
Mario Loriedo
80203302f9 Fix lookup of WSL VMs with matching name
When WSL wasn't installed, the lookup erroneously reported that
a VM with the same name existed. Instead, in this case, the lookup
should return zero matching VMs.

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

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-06-27 10:52:26 +02:00
Mario Loriedo
697f91164a Fix WSL check: assume not installed when --status returns an error
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-06-27 00:43:33 +02:00
Danish Prakash
2d3001a55a Merge pull request #28931 from ROKUMATE/test-pkg-bindings-util
pkg/bindings: Add tests for ToParams and helpers
2026-06-26 21:10:54 +05:30
ROKUMATE
f30dda3837 pkg/bindings: add tests for ToParams and helpers
Fixes: #28930
Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
2026-06-26 17:05:40 +05:30
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
9d537703a2 Merge pull request #28908 from ROKUMATE/main
pkg/copy: add tests for ParseSourceAndDestination
2026-06-25 13:53:36 -04: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
Mikhail Dmitrichenko
9b4484739f systemd: fix negative number conversion
convertNumber() strips the sign before parsing the numeric value and then
applies it back via a multiplier.  The negative case uses -11 instead of
-1, causing negative values to be converted incorrectly.

This is visible for any caller using the signed result directly, and can
also produce surprising results for unsigned callers if the multiplication
overflows.

Use -1 for the negative multiplier.

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko00@bk.ru>
2026-06-25 18:33:10 +03:00
ROKUMATE
c727a0fec7 pkg/copy: add tests for ParseSourceAndDestination
Fixes: #28907

Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
2026-06-24 22:25:26 +05:30
Mario Loriedo
12ea195526 Add new machine test that covers interrupted start command
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-06-24 18:52:15 +02:00
Mario Loriedo
f5d51593ca Fix cleanup callbacks registration in machines Start() function
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-06-24 18:52:15 +02:00
Mario Loriedo
2f3e645b58 Reap completed gvproxy process if machine start fails on Unix
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-06-24 18:52:15 +02:00
Mario Loriedo
37c8dea92a Machine: extend lock to ensure cleanup callbacks completion
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-06-24 18:52:15 +02:00
Mario Loriedo
c6945741e4 Propagate SIGTERM to the VM process during machine start on macOS
Related to https://github.com/podman-container-tools/podman/issues/28318

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-06-24 18:52:12 +02:00
Danish Prakash
de3341fd81 Merge pull request #28977 from jiwahn/fix-kube-oci-annotation-roundtrip
kube: alias OCI runtime annotations without underscores
2026-06-24 20:29:15 +05:30
Paul Holzinger
f0f740a44e Merge commit from fork
fix image host env leak
2026-06-24 16:11:44 +02:00
Mikhail Dmitrichenko
feff567126 checkpoint: close rootfs tar stream after use
chrootarchive.Tar returns an io.ReadCloser backed by a pipe to the
tar-producing process.  CRCreateRootFsDiffTar copies from the stream but
never closes it.

On the successful path the stream is read to EOF, so the producer normally
exits.  On early errors, such as failing to create the destination file or
failing while copying to it, the producer can be left without a consumer.

Close the tar stream after it is created so error paths release the pipe and
allow the producer to exit.

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko00@bk.ru>
2026-06-24 12:32:18 +03: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
Matt Heon
e4c5b6eec0 Merge pull request #29010 from Luap99/wsl-machine
machine/wsl: drop cgroup_manager cgroupfs
2026-06-23 13:41:15 -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
81fd1e6e85 machine/wsl: drop cgroup_manager cgroupfs
I think this should work fine with the defaults. Since we mount the
/etc/containers dir always we should no longer write to /etc/containers.
If we still need this it should be moved into the image and not done at
init time.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-23 13:07:34 +02:00
Jiwoo Ahn
fb8a272fe3 kube: alias OCI runtime annotations without underscores
Fixes: #26871
Signed-off-by: Jiwoo Ahn <ikwydls1314@gmail.com>
2026-06-23 19:24:53 +09: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
6c431b73db fix image host env leak
When parsing image envs we need to be strict about the format, only the
"key=value" format must be accepted. Just keys must be rejected as they
are not valid according to the image spec.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-22 18:39:07 +02: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
Mario Loriedo
a34c29320a Merge pull request #28990 from Luap99/flakes
some flake fixes
2026-06-22 10:44:26 +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
Paul Holzinger
36ba45f39d fix podman volume inspect --all flake
When we loop over all volumes to inspect them it is possible that some
of them got removed in the meantime. As such we must ignore this case to
not cause random command failures.

I have seen this fail in our system tests:
    FAIL: podman volume inspect --format '{{"\n"}}'
expected: = ''
  actual:   Error: no such volume

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-19 17:45:02 +02:00
Paul Holzinger
246724fc60 fix system df flake
When reading the mount path here it can be missing and thus fail with
ENOENT when the voluem is removed in parallel. Because we do not want to
block for a full directory walk of course with the volume lock the only
choice is to ignore the error.

I have seen this error many times in CI in the past weeks:
    FAIL: podman system df --format '{{"\n"}}'
expected: = ''
  actual:   Error: lstat /home/ubuntu.guest/.local/share/containers/storage/volumes/v-t450-1djh1zmh/_data: no such file or directory

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-19 17:44:52 +02:00
guillermodotn
5401c2d51f kube: fix quantityToInt64 dropping scale for fractional BinarySI
Signed-off-by: guillermodotn <guillerm0.n@outlook.es>
2026-06-19 15:56:21 +02:00