Commit Graph

7442 Commits

Author SHA1 Message Date
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
Mario Loriedo
835c8f2d1d Merge pull request #28871 from Luap99/hyperv-flake
machine/hyperV: move ssh mounts to after the ready check
2026-06-19 12:05:58 +02: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
Matt Heon
712b5c77f8 Merge pull request #28966 from jobselko/23741
Fix image search swagger to return array
2026-06-18 12:15:50 -04:00
Matt Heon
20e3bf634b Merge pull request #28951 from MayorFaj/feat/quadlet-image-volume
add support for ImageVolume option in Podman Quadlet
2026-06-18 11:15:53 -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
Miguel Álvarez
5e63372ffa kube play: validate duplicate hostPort bindings across containers
When multiple containers in a pod YAML specify the same hostPort,
podman kube play previously accepted the YAML and started the
containers, causing one of them to fail at runtime with a confusing
bind() error.

Add early validation in getPodPorts() to detect duplicate
(hostIP, hostPort, protocol) tuples across containers and return
a clear error message naming both conflicting containers.

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

Signed-off-by: Miguel Álvarez <mialvare@redhat.com>
2026-06-18 13:30:11 +02:00
Ashley Cui
66a082ed1b Merge pull request #28915 from chanhyeokseo/fix-machine-virtiofs-fcos-home-28911
machine: fix virtiofs mount targets on FCOS
2026-06-17 10:36:51 -04:00
MayorFaj
c6e5eb5553 Add support for ImageVolume option in Podman Quadlet
Signed-off-by: MayorFaj <mayorfaj@gmail.com>
2026-06-17 07:19:07 +01:00
Danish Prakash
5ac01dd4e1 Merge pull request #28897 from ROKUMATE/fix-image-scp-at-username
image scp: preserve usernames containing an "@"
2026-06-17 10:36:46 +05:30
Chanhyeok Seo
61dea3749f machine: fix virtiofs mount targets on FCOS
FCOS symlinks /home to var/home. systemd rejects a mount unit whose
Where= path traverses a symlink, breaking default home dir mounts.

Resolve known FCOS symlinks before writing the ignition unit.

Fixes: #28911
Signed-off-by: Chanhyeok Seo <chanhyeok.seo@datadoghq.com>
2026-06-16 22:52:33 +09:00
Brent Baude
0cba15e256 Merge pull request #28910 from Honny1/fix-hang
Fix client hangs on stale SSH connections
2026-06-15 13:01:31 -05:00
ROKUMATE
b9003828db image scp: preserve usernames containing an "@"
Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
2026-06-12 15:23:25 +05:30
Jan Rodák
f1d0ded43c Convert if/else to switch for transport name comparison
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-06-12 10:12:49 +02:00
Jan Rodák
454a1dea45 Replace deprecated PatternMatcher.Matches with MatchesResult
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-06-12 10:12:49 +02: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
Jan Rodák
ae825f6234 Fix client hangs on stale SSH connections
Wrap ssh.DialNet in a goroutine so it respects context cancellation,
skip retries on context/timeout errors, and invalidate the cached
connection on failure.

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

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-06-11 16:10:25 +02:00
Matt Heon
735d0b0093 Merge pull request #28903 from Luap99/fix-chrootarchive-remote
fix podman-remote save -f oci-dir/docker-dir
2026-06-11 09:58:56 -04: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
fd07b9c6ec fix podman-remote save -f oci-dir/docker-dir
With podman-remote we do not enter a our user namespace like we do with
local podman so we keep running with the real user id.

So if we then try to use chrootarchive as normal user it fails with:
creating mount namespace before pivot: operation not permitted

So simply revert back to the normal archive code.

Now the more interesting thing is we do have a test
"podman save to directory with oci format" but it never runs
rootless+remote in our CI system with our current matrix as we wanted to
reduce jobs.
So rethink the matrix and add one such job as this shows it is needed.

Fixes: 25aee24cbd ("use chrootarchive over plain archive package")

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-10 18:47:02 +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
Jan Rodák
d55b0a0664 Merge pull request #28889 from Luap99/port-conflict
pkg/specgen: fix port conflict on host assignment
2026-06-10 09:44:50 +02:00
Kir Kolyshkin
3c4068bcd6 deps: bump go-criu to v8.2.0
I guess this was not done by renovate/dependabot because of major
version bump.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-06-09 11:51:46 -07:00
Miloslav Trmač
5f5c128abe Merge pull request #28874 from kila-star1127/issue_25067
fix ssh config parsing for HostName
2026-06-09 20:49:25 +02:00
Paul Holzinger
19c579826a pkg/specgen: fix port conflict on host assignment
This fixes two problems when parsing ports.

First, check for host port conflicts. When we are given the same ip:host
port combo twice then we need to reject that as invalid, the backend
cannot bind the same port twice and thus we always get a runtime
failure. Failing early in the create code path is much better.

Second, when assigning random ports for expose we still have to check
for proper conflicts. The first error was using allUsedContainerPortsMap
to check for conflicts but this holds container side ports, we need to
ensure there are no conflicts on the host port.

Then there was the other issue that the array in the map was copied and
accessed by value on lookup. And because the code did not reassign the
value it then failed to actually update the correct ports.
To address that I switch the map to store the array by reference which
will avoid the bigger copies as we only need to update the pointer now.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-09 16:12:35 +02:00
crawfordxx
d0f97989ad machine: escape % as %% in proxy values written to systemd unit conf
systemd interprets % as specifier characters in unit configuration files
(e.g. %H, %u, %40). Proxy environment variable values that contain
percent-encoded URL characters (such as %40 for @ in usernames) cause
systemd to emit warnings and fail to parse the generated
/etc/systemd/system.conf.d/default-env.conf:

  system.conf.d/default-env.conf:2: Failed to resolve specifiers in
  HTTP_PROXY=http://user%40example.com@proxy:3128

Fix by adding a bash variable substitution that doubles every % to %%
before writing to the systemd unit conf files. The profile.d and
environment.d destinations do not need this escaping and continue to
use the original value.

Fixes #28698

Signed-off-by: crawfordxx <crawfordxx@users.noreply.github.com>
2026-06-06 12:04:48 +08:00
Jannik Glückert
b0cb2bb011 fix ssh config parsing for HostName
A later invocation to url.Parse() needs a preceding scheme,
otherwise the hostname just gets discarded.

Fixes #25067

Signed-off-by: Jannik Glückert <jannik.glueckert@gmail.com>
Signed-off-by: KILA <32559459+kila-star1127@users.noreply.github.com>
2026-06-05 18:10:07 +00:00
Paul Holzinger
8472bf223e machine/hyperV: move ssh mounts to after the ready check
We are seeing frequent flakes in hyperV machine tests. The machine start
fails with an ssh handshake failure:

ssh: handshake failed: read tcp 127.0.0.1:56425->127.0.0.1:56377:
wsarecv: An existing connection was forcibly closed by the remote host.

Normally we do the ssh probe in conductVMReadinessCheck() with a retry
mechanism, however because the hyperV mount code already used ssh in
PostStartNetworking() we never got there and failed early.

PostStartNetworking seems the wrong place to mount anyway so move this
to MountVolumesToVM() instead which is placed after the ready check
already so it should have a working ssh by then.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-05 18:34:44 +02:00