Commit graph

4636 commits

Author SHA1 Message Date
Brent Baude
80bf6e6a10
Merge pull request #29227 from ashley-cui/dnsnames
Add dnsnames field & fix alias field
2026-08-04 08:49:33 -05:00
Ashley Cui
d05eddd683 Add dnsnames field & fix alias field
Docker now reserves alias specfically for user-defined aliases, and uses another field, dnsnames, to hold all aliases, including container ID and name.
Part of docker v1.45 compat work, but this touches the cli too, since they updated it there too.

Signed-off-by: Ashley Cui <acui@redhat.com>
2026-08-03 16:19:14 -04:00
Lokesh Mandvekar
30234265b2
Merge pull request #29242 from Honny1/pesto-addtional-tests
Add pesto port forwarding with source IP preservation
2026-07-29 10:29:40 -04:00
Paul Holzinger
2b5572b0a6
libpod: unset network state in reloadContainerNetwork
Ensure we set the network status to nil after the teardown and save it
to the db. This is needed on network reload as the setup reads the
existing status for the pesto forwarding logic.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-07-28 18:52:27 +02:00
Jan Rodák
756732974b
Move pesto port forwarding to container-libs and vendor container-libs
This makes use of the new pasta integration code in container-libs.

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-07-28 18:29:52 +02:00
Sheikh Muneeb Ahmed
b0634a4eea libpod: use %w instead of %v in fmt.Errorf calls
Errors returned in the healthcheck timer path and events inspect data were formatted with %v, discarding the error chain. Replaced with %w so callers can use errors.Is/errors.As to inspect the underlying causes.

Signed-off-by: Sheikh Muneeb Ahmed <msheikh.bsai24seecs@seecs.edu.pk>
2026-07-28 18:42:22 +05:00
Jiwoo Ahn
f85047302c libpod: cleanup after failed container init
Fixes: #26143

Signed-off-by: Jiwoo Ahn <ikwydls1314@gmail.com>
2026-07-23 22:42:14 +09:00
Evzen Gasta
a19b696de1 feat(info): add memAvailable to host info
Expose MemAvailable alongside MemFree/MemTotal in `podman info` host
section, sourced from libpod/define/info.go's MemInfo.

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

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Evzen Gasta <evzen.ml@seznam.cz>

test(info): add coverage for host.memAvailable

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Evzen Gasta <evzen.ml@seznam.cz>
2026-07-22 08:41:59 +02:00
Danish Prakash
5561e6c416
Merge pull request #29168 from Honny1/fix-json-format
Fix inspect template `.HostIp` for Docker compatibility
2026-07-14 13:38:30 +05:30
Jan Rodák
030b0be9d8
Add HostIp() method to InspectHostPort for Docker template compat
Docker-compatible inspect templates using `{{.HostIp}}` fail in Podman
because Go templates resolve by struct field name (`HostIP`), not JSON
tag (`HostIp`). Add a `HostIp()` method so both notations work.

Note: this does not address the struct-vs-map difference that prevents
`range` over individual port bindings (would require an API break).

Relates: https://github.com/podman-container-tools/podman/issues/29164

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-07-13 16:08:11 +02:00
Jan Rodák
7ac3e83707
Fix duplicated command in inspect Args when container has single-element command
Fixes: https://github.com/podman-container-tools/podman/issues/29155

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-07-09 17:31:21 +02:00
Jan Rodák
7ab215c0be
Vendor container-libs with PestoSocketPath interface method
- go.podman.io/storage@main
- go.podman.io/image/v5@main
- go.podman.io/common@main

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

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-07-07 17:56:03 +02: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
b4aaaee306
podman log-level debug must produce the same oci runtime errors
I do not understand this condition in the code, not passing the log file
to the runtime when run with log level debug makes no sense. It means we
do not get the proper error message from the runtime so debug logging
shows a much worse error:
"container create failed (no logs from conmon)..."

When the actual error is the command is not in $PATH for example. So to
fix this just remove the log level check. Also not the support json flag
condition is done inside execOCILog().

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-30 13:02:57 +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
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
Jan Rodák
60e90c14ec
Merge pull request #28664 from givensuman/fix/generate-kube-healthcheck
Export container healthcheck as LivenessProbe in generate kube
2026-06-25 17:32:57 +02:00
Danish Prakash
de3341fd81
Merge pull request #28977 from jiwahn/fix-kube-oci-annotation-roundtrip
Some checks are pending
ci / sys local root fedora-prior (push) Blocked by required conditions
ci / int local rootless fedora-prior (push) Blocked by required conditions
ci / sys local rootless fedora-prior (push) Blocked by required conditions
ci / int remote root fedora-prior (push) Blocked by required conditions
ci / sys remote root fedora-prior (push) Blocked by required conditions
ci / int local root fedora-rawhide (push) Blocked by required conditions
ci / sys local root fedora-rawhide (push) Blocked by required conditions
ci / int local rootless fedora-rawhide (push) Blocked by required conditions
ci / sys local rootless fedora-rawhide (push) Blocked by required conditions
ci / int remote root fedora-rawhide (push) Blocked by required conditions
ci / sys remote root fedora-rawhide (push) Blocked by required conditions
ci / apiv2 root fedora-current (push) Blocked by required conditions
ci / bindings root fedora-current (push) Blocked by required conditions
ci / compose_v2 root fedora-current (push) Blocked by required conditions
ci / docker_py root fedora-current (push) Blocked by required conditions
ci / unit root fedora-current (push) Blocked by required conditions
ci / apiv2 rootless fedora-current (push) Blocked by required conditions
ci / compose_v2 rootless fedora-current (push) Blocked by required conditions
ci / unit rootless fedora-current (push) Blocked by required conditions
ci / upgrade v5.3.1 root fedora-current (push) Blocked by required conditions
ci / upgrade v5.6.2 root fedora-current (push) Blocked by required conditions
ci / machine linux amd64 (push) Blocked by required conditions
ci / windows unit (push) Blocked by required conditions
ci / windows e2e (push) Blocked by required conditions
ci / windows machine hyperv (push) Blocked by required conditions
ci / windows machine wsl (push) Blocked by required conditions
ci / macos machine applehv (push) Blocked by required conditions
ci / macos machine libkrun (push) Blocked by required conditions
ci / Total Success (push) Blocked by required conditions
zizmor: GitHub Actions Security Analysis / Zizmor (push) Waiting to run
kube: alias OCI runtime annotations without underscores
2026-06-24 20:29:15 +05:30
Matt Heon
cbdb3126e9
Merge pull request #29016 from Luap99/exec-cleanup
fix cleanupExecBundle locking and some more exec releated cleanups
2026-06-24 09:46:40 -04:00
Mikhail Dmitrichenko
b8cc54238b libpod: close checkpoint export tar stream
chrootarchive.Tar returns an io.ReadCloser backed by the tar-producing
process.  The checkpoint export path copies from that stream into the
target file, but never closes the reader.

A successful copy reads the stream to EOF, so the producer normally exits.
On early errors, such as failing to create or chmod the target file, or a
copy error, the producer can be left without a consumer.

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

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko00@bk.ru>
2026-06-24 13:30:13 +03:00
Devesh B
07289d6cd3 fix(kube): export container healthcheck as LivenessProbe in generate kube
Fixes: #22095

Now handles exporting a container's healthcheck configuration as a
`livenessProbe` in the generated Kubernetes YAML.

Co-authored-by: givensuman <givensuman@duck.com>
Co-authored-by: Jan Rodák <hony.com@seznam.cz>

Signed-off-by: Devesh B <98201065+DeveshB-1@users.noreply.github.com>
Signed-off-by: givensuman <givensuman@duck.com>

Update test/e2e/generate_kube_test.go

Co-authored-by: Jan Rodák <hony.com@seznam.cz>
Signed-off-by: given <givensuman@gmail.com>
2026-06-23 17:10:27 -04:00
Paul Holzinger
d9bab9caac
libpod: correctly guard StartedTime access in runHealthCheck
The state must be synced from the db when we are locked otherwise it
contains incorrect values.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-23 18:59:30 +02:00
Paul Holzinger
cd6807c7c0
libpod: remove LegacyExecSessions
This have been deprecated in podman 1.9, it is safe to assume they are
no longer used by anyone one a recent version.

If someone would update from the old version to 6+ they would run into
much more issues already so this can be safely dropped IMO.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-23 18:47:08 +02:00
Paul Holzinger
ae04ee07b1
libpod: remove extra state lookup in HealthCheck()
Checking the state outside of locks is not safe and does not guarantee
us anything as the container could be stopped afterwards anyways.

So just skip the state check and then later in the exec logic we do the
same check again and return ErrCtrStateInvalid so just handle that
afterwards.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-23 18:47:07 +02:00
Paul Holzinger
f7b85f85a8
libpod: remove unused ExecStop
The function is never called so remove it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-23 18:10:32 +02:00
Paul Holzinger
8fa167ad93
libpod: remove locking rule from cleanupExecBundle
This is used incorrectly by execLightweight which called the function
unlocked which of course does not show up normally as only when there
is a race condition that makes the removal fail we go to unlock and then
the process panics as a double unlocked is not allowed.

While we could fix the caller such incorrect use is way to easy and
the unexpected lock/unlock cycle is basically never expected. Instead
just keep the container locked, that may prevent other commands from
doing something with the container in parallel but the error should be
rare enough to not matter most of the time. And we wait 5s max so it is
not a long time either.

To try to make the wait interval a bit faster poll every 50ms now as we
no longer have to the expensive locking and db sync each iteration.

Fixes: #29012

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-23 18:10:31 +02:00
Radostin Stoyanov
2c7aeab70b Freeze cgroup during live checkpoint
When checkpointing a container with --leave-running, libpod dumps the
container's memory via the OCI runtime (CRIU) first and only captures
the rootfs diff and named volumes afterwards. CRIU thaws the container
as soon as the memory dump finishes, so the processes inside the
container continue to run between the memory snapshot and the
file-system capture. As a result, the checkpoint can be inconsistent:
have CRIU images and a file system that reflect different points in time.

To fix this, we freeze the container's cgroup before invoking the OCI
runtime and thaw it again only after the checkpoint image/archive has
been written. The OCI runtime calls CRIU with the freezer cgroup and
restores it to its previous state once the dump completes, so a
container that was already frozen stays frozen across the dump and
the file system is captured at the same instant as the CRIU images.
This mirrors the approach other engines (e.g. CRI-O and containerd).

The default (stopping) checkpoint functionality is not affected by this
issue because CRIU leaves the tasks dead after the dump.

This patch also adds a regression test for the consistency of live
(--leave-running) checkpoints. The container runs a workload that
keeps an in-memory counter in sync with a value written to a file
on its root file system, maintaining the invariant that the on-disk
value never gets ahead of the in-memory counter.

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2026-06-23 13:30:32 +01: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
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
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
Grzegorz Szczepanczyk
697fa0cc19 fix: clearer error for a privileged port on a specific IP (macOS)
With podman machine, gvproxy forwards published ports by binding them on
the host (not inside the VM) and runs unprivileged. macOS refuses to bind
a privileged port (< 1024) to a specific IP for a normal user, even though
binding all interfaces is fine, so publishing e.g. -p 127.0.0.1:80:80 used
to fail with an opaque "something went wrong with the request".

Pass the published ip:port into the gvproxy error helper and, when the body
says "permission denied" for a < 1024 port on a specific IP, return an
error that explains gvproxy binds on the host and suggests dropping the
host IP or using a port >= 1024. The raw body is kept for every other case.
Add unit tests for the helper.

Fixes: #28009

Signed-off-by: Grzegorz Szczepanczyk <g.szczepanczyk@getprintbox.com>
2026-06-19 13:25:09 +02:00
Matt Heon
df12c9806c
Merge pull request #28214 from MayorFaj/feat/28189-volume-rename
Some checks are pending
ci / int local rootless fedora-prior (push) Blocked by required conditions
ci / sys local rootless fedora-prior (push) Blocked by required conditions
ci / int remote root fedora-prior (push) Blocked by required conditions
ci / sys remote root fedora-prior (push) Blocked by required conditions
ci / int local root fedora-rawhide (push) Blocked by required conditions
ci / sys local root fedora-rawhide (push) Blocked by required conditions
ci / int local rootless fedora-rawhide (push) Blocked by required conditions
ci / sys local rootless fedora-rawhide (push) Blocked by required conditions
ci / int remote root fedora-rawhide (push) Blocked by required conditions
ci / sys remote root fedora-rawhide (push) Blocked by required conditions
ci / apiv2 root fedora-current (push) Blocked by required conditions
ci / bindings root fedora-current (push) Blocked by required conditions
ci / compose_v2 root fedora-current (push) Blocked by required conditions
ci / docker_py root fedora-current (push) Blocked by required conditions
ci / unit root fedora-current (push) Blocked by required conditions
ci / apiv2 rootless fedora-current (push) Blocked by required conditions
ci / compose_v2 rootless fedora-current (push) Blocked by required conditions
ci / unit rootless fedora-current (push) Blocked by required conditions
ci / upgrade v5.3.1 root fedora-current (push) Blocked by required conditions
ci / upgrade v5.6.2 root fedora-current (push) Blocked by required conditions
ci / machine linux amd64 (push) Blocked by required conditions
ci / windows unit (push) Blocked by required conditions
ci / windows e2e (push) Blocked by required conditions
ci / windows machine hyperv (push) Blocked by required conditions
ci / windows machine wsl (push) Blocked by required conditions
ci / macos machine applehv (push) Blocked by required conditions
ci / macos machine libkrun (push) Blocked by required conditions
ci / Total Success (push) Blocked by required conditions
Publish swagger / Build and publish swagger.yaml (push) Waiting to run
zizmor: GitHub Actions Security Analysis / Zizmor (push) Waiting to run
feat: implement volume rename functionality
2026-06-18 14:47:35 -04:00
Tibor Dudlák
5d18575f41
fix: Update the typo in comment
Signed-off-by: Tibor Dudlák <Tibor.Dudlak@airbank.cz>
2026-06-18 14:56:24 +02:00
s3onghyun
8a43be8205 libpod: fix "to to" typo in container_top comment
Signed-off-by: s3onghyun <s3onghyun.hong@gmail.com>
2026-06-18 17:52:11 +09:00
Danish Prakash
c89c571efd
Merge pull request #28928 from priyanshsao/fix-typo
fix: correct misspelled comment in container_inspect.go
2026-06-15 20:24:21 +05:30
Priyansh Sao
58d7314ee2 fix: correct misspelled comment in container_inspect.go
This replaces the misspelled word in comments "Exosed" with the correct spelling "Exposed" in the file container_inspect.go.

Fixes: #28927

Signed-off-by: Priyansh Sao <saopriyansh06@gmail.com>
2026-06-13 07:15:17 +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
Jan Rodák
7fe6abf197
Merge pull request #28879 from jiwahn/fix-event-attributes-labels
events: include labels in pod and volume attributes Fixes: #26480
2026-06-11 10:27:38 +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
331946fd79
Merge pull request #28876 from solunolab/main
chore: fix some function names in comment
2026-06-10 07:30:30 +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
Jan Rodák
ee986cd7c9
Use MNT_DETACH for SHM unmount instead of retry loop
After checkpoint the SHM tmpfs can briefly return EBUSY while the
kernel releases mount propagation references. Use lazy unmount
instead of retrying, as suggested by review.

Fixes flake: `podman checkpoint/restore ip and mac handling`

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-06-09 14:57:27 +02:00
Jiwoo Ahn
ef2d2e4a58 events: include labels in pod and volume attributes
Fixes: #26480

Signed-off-by: Jiwoo Ahn <ikwydls1314@gmail.com>
2026-06-09 20:36:04 +09:00
solunolab
cba51d1de4 chore: fix some function names in comment
Signed-off-by: solunolab <solunolab@outlook.com>
2026-06-07 11:29:49 +08:00
Paul Holzinger
fab963e01c
Merge pull request #28693 from kolyshkin/change-label
bump selinux to v1.15.1, use SetProcessKind
2026-06-03 18:42:58 +02:00
Giuseppe Scrivano
1c2a2ffe87
cmd, commit: register shutdown handler to unpause container
When --pause defaults to true, a Ctrl-C during commit would leave the
container paused.  Register a shutdown handler that unpauses the
container on SIGINT/SIGTERM so it is always restored to its running
state.

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
Giuseppe Scrivano
db804fb1b9
cmd, commit: also pause stopping containers during commit
ContainerStateStopping is still a running state where processes are
active, so it should also be paused during commit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2026-06-03 07:28:18 +02:00
Kir Kolyshkin
ad7b6be2b9 bump selinux to v1.15.1, use SetProcessKind
I was not able to find any external users of pkg/selinux but kept it
for now (and marked as deprecated) so we can remove it later.

PS pkg/selinux adds go:fix directives which are not (yet) recognized
by the gocheckcompilerdirectives linter, so add a temporary exception).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-06-02 11:18:34 -07:00
zhongchunhe.zch
af563a9a10 Some improvements for libpod.
Signed-off-by: zhongchunhe.zch <zhongchunhe.zch@qq.com>
2026-06-02 19:02:38 +08:00