Commit Graph

7323 Commits

Author SHA1 Message Date
Lokesh Mandvekar
9b253ab347 Update stale comments referencing slirp4netns
Replace remaining references to Slirp/slirp4netns in code comments
with Pasta or remove them where the reference is no longer relevant.

Signed-off-by: Lokesh Mandvekar <lsm5@linux.com>
2026-04-27 10:22:26 -04:00
Matt Heon
cc2e2c94b8 Merge pull request #27929 from kairosci/fix/27786-health-field-containers-json
compat: Add Health field to /containers/json endpoint
2026-04-23 11:39:08 -04:00
Alessio Attilio
c4a4c7e117 API: Add Health field to compat ListContainers and restrict to v1.52+
Signed-off-by: Alessio Attilio <attilio.alessio@protonmail.com>
2026-04-23 08:39:43 +00:00
Nabil Houidi
d44655537e fix: ensure infra image is set from infra container spec in PodConfigToSpec
fixes #21609

Signed-off-by: Nabil Houidi <35373676+NabilHouidi@users.noreply.github.com>
2026-04-22 23:47:00 +02:00
Brent Baude
2cc3be7332 RUN-4539: Change podman module paths
The podman module paths are moving from github.com/containers/podman to
go.podman.io/podman.  This will help with future mobility.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2026-04-22 14:02:25 -05:00
Matt Heon
3279767614 Merge pull request #28336 from l0rd/import_native_ca
Import host trusted certificates into the guest machine - Windows part
2026-04-22 13:04:55 -04:00
Brent Baude
9ac300c6af Merge pull request #28535 from lstocchi/i25037
auto-add user to Hyper-V Administrators group
2026-04-22 10:31:55 -05:00
lstocchi
57eeb47143 auto-add user to Hyper-V Administrators group
Currently, running Podman on Hyper-V as a non-administrator requires the user to be a member of the "Hyper-V Administrators" local group. If they are not, various WMI calls fail with access denied.

This commit automates the permission setup.
1. During podman machine init, if Podman is running with elevated privileges (required for registry/networking setup anyway), it will now automatically add the current user to the localized "Hyper-V Administrators" group
2. If a user is added to the group, the change is not reflected until the next login. We now detect this state and explicitly instruct the user to log out and back in.
3. Modified the Hyper-V stubber to handle permission checks at the method level rather than the provider selection level (GetAll). This allows init to continue far enough to perform the elevation and setting.

Signed-off-by: lstocchi <lstocchi@redhat.com>
2026-04-22 11:03:37 +02:00
Brent Baude
2e6f29a2df RUN-4538: Fix buildah vendoring
This PR reflects the upstream change of moving the buildah module from
github.com/containers/buildah to go.podman.io/buildah.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2026-04-21 14:27:58 -05:00
Paul Holzinger
ff6fb6eb2d Merge pull request #28508 from jankaluza/configfile
trust: switch policy.json lookup to configfile
2026-04-21 12:04:43 +02:00
Matt Heon
98ca040cd7 Merge pull request #28536 from zhangguanzhang/fix-tmp
Clean up temporary file for CreateImageFromSrc
2026-04-20 18:19:20 -04:00
Jan Kaluza
cae4c40323 compat: limit err scope in CommitContainer.
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2026-04-20 15:11:34 +02:00
Jan Kaluza
03afb7403d trust: fail on policy path resolution errors, remove fallback logic
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2026-04-20 15:11:34 +02:00
Jan Kaluza
54d61c2f02 trust: switch policy.json lookup to configfile
Use shared configfile instead of custom policy.json path handling.
This updates ocipull to rely on signature.DefaultPolicy(), removes
explicit SignaturePolicyPath, and replaces trust's custom default-policy
path logic with common configfile code.

Replace hidden `--policypath` with --signature-policy` and require
it for `trust set` command instead of path resolution based on
configfile.

For `trust get`, the `--signature-policy` is optional.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2026-04-20 15:11:22 +02:00
Jan Rodák
ecf493dea0 Fix Docker compat /wait hanging on fast-exiting containers
The Docker client (docker run) sends /wait then /start, but it only
sends /start after receiving the 200 OK response from /wait. Previously,
the event subscription for the "died" event was set up after the 200 was
sent, creating a window where a fast-exiting container (e.g. hello-world)
could emit its "died" event before the subscription was ready, causing
the client to hang forever.

Fix this by subscribing to "died" events before flushing the 200 status
code. This guarantees the event listener is ready before the client can
send /start, eliminating the race entirely.

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

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-04-20 15:01:42 +02:00
Paul Holzinger
34a4633d5f Merge pull request #28275 from mheon/ordered_networks
Move to deterministic network setup order
2026-04-20 12:33:13 +02:00
Jan Rodák
7534429ade Merge pull request #28524 from Luap99/isolate
remove isolate option from docker compat API
2026-04-20 10:03:27 +02:00
Jan Rodák
2fd0d2636c Merge pull request #28528 from inknos/pod-option-quadlet
Add Pod to quadlet list
2026-04-20 10:02:03 +02:00
zhangguanzhang
64f9059d2e Fixes: #28531 Clean up temporary file for CreateImageFromSrc
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2026-04-18 19:38:37 +08:00
Matthew Heon
efba9996f6 Implement --save-stages/--stage-labels for build
These are two new Buildah flags that we need to wire into Podman
(both local and remote) and document, with the interesting note
that one requires the other and a check needed to be added for
that.

Also: secret parsing was tightened up in Buildah, and was
breaking the remote build tests. Rewire it to use the new parser
Buildah made, which ends up simplifying the code considerably.
Tests are back to passing afterwards.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2026-04-17 10:00:32 -04:00
Matthew Heon
5e94c95ad0 Move to deterministic network setup order
This was implemented by containers/netavark #1369; this commit
completes the process by wiring it into Podman. We now respect
the CLI order for configured networks - if a user passes
`--net net1,net2` we guarantee that net1 will be configured
before net2.

For containers created before this patch, we don't retain enough
information to configure networks in CLI order, so we use
alphabetical order instead to still guarantee consistency.

No breaking API changes have been made, but we do add a new
field to supplement the existing map to (optionally) provide
ordering information. The Podman CLI will always pass this.
Existing applications that do not will, again, receive]
deterministic ordering based on an alphabetical sort of network
names.

This requires the latest version of Netavark to work properly.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2026-04-17 10:00:32 -04:00
Nicola Sella
d92cc360f1 Add Pod to quadlet list
Fixes: https://redhat.atlassian.net/browse/RUN-3835

Signed-off-by: Nicola Sella <nsella@redhat.com>
2026-04-17 13:42:16 +02:00
Donal O'Sullivan
f15b8e1b2b Sort cliOpts fields alphabetically in Compat Create
Improve code readability by sorting ContainerCreateOptions field
assignments alphabetically and simplifying access to embedded
Config fields.
Fixes: #28377

Signed-off-by: Donal O'Sullivan <donal.osullivan@elastic.co>
2026-04-16 16:38:26 +01:00
Paul Holzinger
41b785af5e remove isolate option from docker compat API
With netavark v2 we start to default to strict isolation mode in
netavark[1] as such that already matches the docker behavior.

Therefore no longer hard code the isolate option in the compat api.

Podman v6 is requires netavark v2 for other changes already so we do
not need to worry about podman 6 + older netavark here.

[1] https://github.com/containers/netavark/pull/1438

Fixes: #27349

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-16 15:56:44 +02:00
Mario Loriedo
f7dd6156d3 Import host certificates at machine startup on Windows
Implements the feature introduced in the design
document added with commit 4bdc1d37

Fixes https://redhat.atlassian.net/browse/RUN-4260

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-04-16 13:35:40 +02:00
Paul Holzinger
e4776a2dc6 Merge pull request #28498 from Honny1/hc-transient-store
Fix healthcheck failing silently with `--transient-store`
2026-04-15 19:13:19 +02:00
Paul Holzinger
ea4a7f9b65 Merge pull request #28454 from aadi58002/main
fix(#28429): OCIRuntime field in SpecGenerator is ignored when called through HTTP Rest API
2026-04-15 14:33:24 +02:00
Matt Heon
e5f484964a Merge pull request #28495 from Honny1/fix-device-compat-api
Fix Docker API DeviceMapping for CDI devices
2026-04-14 08:42:26 -04:00
Jan Rodák
9598b30ac2 Fix healthcheck failing silently with --transient-store
The systemd timer created for health checks did not pass global
podman flags to the subprocess, causing it to use default storage
settings instead of matching the parent process. This is most
visible with --transient-store, where the healthcheck looks up
the container in the default store instead of the volatile one.

Extract GlobalPodmanArgs() from CreateExitCommandArgs so both the
exit command and healthcheck timer share the same set of global
flags (--root, --runroot, --transient-store, --storage-driver, etc.).

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

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-04-14 14:13:20 +02:00
aadi58002
698c483b7c fix: Ensure OCIRuntime Field is not ignored with HTTP Rest Api (#28454)
Signed-off-by: aadi58002 <aadi58002@gmail.com>
2026-04-14 13:48:11 +05:30
Ygal Blum
8059539425 Quadlet - Support empty source for Mount key
Fixes: #28497

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2026-04-13 17:28:33 -04:00
Jan Rodák
f374f2c95b Fix Docker API DeviceMapping for CDI devices
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-04-13 20:56:37 +02:00
Paul Holzinger
05ff49a103 Merge pull request #27828 from lsm5/podman6-no-slirp-new
Podman6: Remove slirp
2026-04-13 19:24:28 +02:00
Paul Holzinger
571c842bd3 hyperV: fix powershell path escape
To avoid special chars from being interpreted.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-13 19:01:49 +02:00
Lokesh Mandvekar
9ff3f4cb1e Clean up outdated slirp4netns references in comments
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-04-13 09:05:09 -04:00
Lokesh Mandvekar
42a98a5a82 Remove slirp4netns from CLI and completions
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-04-13 09:04:41 -04:00
Lokesh Mandvekar
cefb944647 Remove slirp4netns setup functions (preserve RLK)
Remove all slirp4netns-specific setup and helper functions while
preserving the RootlessRLK port mapping functions that are still
used by pasta and bridge networking.

Rename networking_slirp4netns.go to networking_rootlessport.go.
Convert the slirp4netns compose test to use pasta instead.
Remove rootlessSlirpSyncR/W fields from container struct and
getSlirp4netnsIP stub from FreeBSD networking.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-04-13 09:04:41 -04:00
Lokesh Mandvekar
e81328e2a2 Remove Slirp network mode constant and error on usage
Using --network=slirp4netns now returns a hard error directing
users to pasta and `podman system migrate`.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-04-13 08:22:36 -04:00
Lokesh Mandvekar
3317eb9abb Set pasta as default when default_rootless_network_cmd is unset
Previously, when default_rootless_network_cmd was empty, podman
would fall back to slirp4netns. Change this to default to pasta
instead. Remove the now-unused slirp4netns import.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-04-13 08:22:36 -04:00
Mario Loriedo
e3b5d0f1ad Merge pull request #27932 from lstocchi/i27627
Propose running init/rm command on hyperv machine in elevated mode when required
2026-04-10 18:21:20 +02:00
Paul Holzinger
5ae63471cf Merge pull request #28469 from Luap99/fixes
some small fixes
2026-04-09 13:36:36 +02:00
Paul Holzinger
12bec19426 bindings: artifact extract reject invalid names
The server already does validate this so this is not strictly needed and
the client must trust the server no matter what.

But adding an extra check here does not hurt and may help prevent future
bugs.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-08 19:58:08 +02:00
Paul Holzinger
25aee24cbd use chrootarchive over plain archive package
Just as additional hardening.

Note chrootarchive does not work on macos/windows, in that case it still
falls back to the regular pkg/archive.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-08 19:58:07 +02:00
Paul Holzinger
abb5120624 fix symlink handling in checkpoint restore
Under normal circumstances this is not a problem as the archive file
created podman container checkpoint will no create symlinks.
However if a user passes a custom archive they could contain symlinks
that point outside our root. To resolve them within the root use
securejoin.

Note this is not a security problem because the full archive must be
trusted by a user to begin with as it contain the full container config.

Fixes: #27977

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-08 19:57:02 +02:00
Paul Holzinger
3f2886556b Merge pull request #28356 from Honny1/fix-remote-build
Remote build: `nTar` secrets with relative paths and ignore bypass
2026-04-08 19:49:48 +02:00
Tom Sweeney
12c656234c Merge pull request #28430 from Honny1/fix-containerignore
Fix .containerignore patterns with leading/trailing slashes
2026-04-03 17:32:29 -04:00
lstocchi
a9a9eda883 rename ErrRelaunchAttempt to ErrRelaunchSucceeded and fix elevated error handling
The old ErrRelaunchAttempt name was ambiguous — it reads as though the
relaunch attempt failed, when it actually signals success. Rename to
ErrRelaunchSucceeded and update comments at every call site to clarify
that this is not a real error but a sentinel indicating the elevated
child process completed the operation successfully.

Also fix a bug in WSL's launchElevate where a failed elevated process
was incorrectly wrapped with the sentinel, causing callers to treat the
failure as success and print "Machine init complete."

Signed-off-by: lstocchi <lstocchi@redhat.com>
2026-04-03 18:37:24 +02:00
lstocchi
8e5fde01c6 propose running init/rm command on hyperv machine in elevated mode
This commit adds automatic UAC elevation prompts for HyperV machine
init/rm actions when administrator privileges are required.
Previously, users had to manually run Podman as administrator
when creating the first machine or removing the last machine, which
requires Windows Registry modifications.

When the HyperV command gets relaunched as elevated, the error of the
elevated process is saved on a file to be displayed by the caller. The
implementation is the same as that used by WSL.

Signed-off-by: lstocchi <lstocchi@redhat.com>
2026-04-03 18:37:08 +02:00
lstocchi
5b0ec91c54 move wsl' util_windows to windows package so it can be reused by hyperv
Signed-off-by: lstocchi <lstocchi@redhat.com>
2026-04-03 14:32:09 +02:00
Paul Holzinger
d20933df02 add missing O_CLOEXEC to open calls
The go std os package to will always make sure to use O_CLOEXEC, however
in cases where we directly call unix.Open() we need to pass that flag
explicitly.

I looked at this as there was a report of a leaked fd on the pasta list,
though I am not sure this will address it.

But anyway doing this should be rather safe and avoid leaks into other
processes.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-02 15:06:37 +02:00