6967 Commits

Author SHA1 Message Date
2b6c477884 quadlet: handle generate environment params that inherit from host
Fixes: #26247

Signed-off-by: Volodymyr Pankin <volopank@gmail.com>
2025-06-10 20:50:13 +02:00
22789928d4 podman machine: pull wsl image from machine-os
Starting with [1] we now build and publish the wsl image from the
machine-os repo, as such this special case is no longer needed.

[1] https://github.com/containers/podman-machine-os/pull/142

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-10 18:09:21 +02:00
5ff067cdcd Merge pull request #26282 from alaviss/push-wotrztyxpmou
quadlet: generate RequiresMountsFor for Type=bind volumes
2025-06-10 09:02:32 +00:00
2825521337 tmpfs: Add support for noatime mount option
'noatime' flag disables updates to file access times when files are read. This can reduce unnecessary writes and improve performance, especially in read-heavy workloads. Previously, tmpfs did not recognize the 'noatime' mount option and would return an error.

With this change, tmpfs now properly accepts and handles the 'noatime' option.

Fixes: #26102

Signed-off-by: Arthur Wu <lion811004@gmail.com>
2025-06-06 22:21:45 -04:00
246a688ee0 Merge pull request #26288 from Luap99/vendor
vendor: update docker, common, image, storage and buildah
2025-06-06 21:01:43 +00:00
0f7b21ad00 pkg/machine: remove unsused net recover file
This is not used in the code so it can be deleted.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-06 19:46:05 +02:00
0c77654be7 Revert "podman machine: fix proxy test"
This reverts commit 0b8dd9084010b1d444d7362c5be6704843c21aba.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-06 19:46:05 +02:00
adc35b157e pkg/machine: remove old fw_cfg service
It has not been in use since commit f218f8430a and should have been
removed there. It seems somehow it is causing a bug since our env file
is empty. In that case it triggers a segfault and since that happens
from within pam we are unable to login in any way.

I reported the issue[1] but because we don't need this just remove it so
we don't have to wait for a fix.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2370858

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-06 19:44:00 +02:00
0b8dd90840 podman machine: fix proxy test
Do not write /etc/environment.d files, something is broken in the new
image that causes the boot to fail when any basic var is set there.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-06 16:13:44 +02:00
0c406f25ad pkg/machine/e2e: skip rosetta test
We disabled it in the machine os image so it can no longer be used
currently.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-06 15:48:28 +02:00
18ecd2046b quadlet: generate RequiresMountsFor for Type=bind volumes
This makes sure that the volume source is available before the volume is
created.

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

Signed-off-by: Hiếu Lê <leorize+oss@disroot.org>
2025-06-05 18:22:28 -05:00
d44f0afa84 vendor: update github.com/docker/docker to v28.2.2
Two incomptable changes, they removed the BridgeNfIP6tables
and BridgeNfIptables fields so we must drop them. As they are not
important ones that should not cause problems.

Second, they moved to using DockerOCIImageConfig from another new module.
The json format did not chnage so this is not an external API break.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-05 12:19:58 +02:00
4871ad1dc6 Merge pull request #26278 from Luap99/quadlet-network-interface
quadlet: add InterfaceName option to network unit
2025-06-04 18:08:07 +00:00
a0f7db44e8 quadlet: add InterfaceName option to network unit
I noticed this was missing, its a simple 1 to 1 mapping to
--interface-name.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-04 16:46:39 +02:00
badf6b8b17 Merge pull request #26111 from ninja-quokka/restful_art
feat: Add OCI Artifact support to the Podman REST API
2025-06-04 14:34:52 +00:00
2d234fab34 Merge pull request #26177 from Luap99/machine-linger
pkg/machine: setup lingering for custom username and remove unnecessary sleep service
2025-06-04 14:04:37 +00:00
8532ecb710 fix wsl install workflow on machine init command
this patch changes how the detection of wsl works.
The old way of using wsl --status command output to detect some missing features required by WSL is not fully reliable.
WSL checks if the wsl feature is enabled and if the vmcompute service do exist. However, this is not enough to identify if the virtual machine platform feature is enabled. The vmcompute service could exist because it has been installed by other tools or it could exist but being stopped.

The way proposed by this patch is to try execute the import command and,
if it fails, check the error and if it is related to the Host Compute
Service try to install all features required by WSL.

The flow is the same as before, the user is asked to execute the podman
machine init command with elevated privileges. Eventually, after
enabling WSL and VMP features, the user is asked to reboot the machine.

When the machine restarts, the powershell gets invoked again and execute
the command init.

The code also fixes some issues that could cause misbehaviors when
invoking recursively the elevated shell, like an unreleased lock, or a
missing file.

Signed-off-by: lstocchi <lstocchi@redhat.com>
2025-06-04 14:26:48 +02:00
99cfdc04db feat: Add OCI Artifact support to the Podman REST API
This patch adds a new endpoint to the REST API called "artifacts" with
the following methods:
- Add
- Extract
- Inspect
- List
- Pull
- Push
- Remove

This API will be utilised by the Podman bindings to add OCI Artifact
support to our remote clients.

Jira: https://issues.redhat.com/browse/RUN-2711

Signed-off-by: Lewis Roy <lewis@redhat.com>
2025-06-04 15:49:34 +10:00
87450b8f8b podman buildx inspect support
Added support for "podman buildx inspect". The goal was to replicate the default output from "docker buildx inspect" as
much as possible but a problem encountered was podman not supporting BuildKit. To replicate the output I resorted to
printing the statements with default values but only changed the driver name to use podman instead of docker. Since
there was no buildkit, gave it the value of "N/A" to depict it's not supported. For Platforms, I resorted to using
the emulated architectures found on your linux system + the host architecture of your local machine or podman server. The
bootstrap flag was also added but is considered a NOP since there is no buildkit container to run before running inspect.
An extra field was added to the HostInfo struct so when you run "podman info" the emulated architectures will show, this
was used so you can grab the information from the podman engine.

Fixes #13014

Signed-off-by: Joshua Arrevillaga <2004jarrevillaga@gmail.com>
2025-06-03 11:07:08 -04:00
da95bbdd5d play kube: never add empty alias
Netavark v1.15 added new warnings on some invalid names and that
triggerd a new test failure in podman e2e test.

The "Podman kube play with disabled cgroup" case now complains about an
empty name:
podman [options] kube play /tmp/CI_aM20/podman-e2e-3156601197/subtest-3441376193/p/kube.yaml
[WARN  netavark::network::bridge] invalid network alias "": name is empty, ignoring this name

This is because this test does not set a container name thus the code
was adding an empty string so to fix it check if the name is not empty
first.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-02 17:58:30 +02:00
3b91669cd4 Merge pull request #26235 from mheon/fix_26101
Allow not specifying type with --mount flag
2025-05-30 20:50:20 +00:00
3837339e0e Allow not specifying type with --mount flag
Docker does not require `--type` to be passed, defaulting to
`type=volume` in cases where it's not passed. Do the same in our
volume parsing, and add a test to verify this works as expected.

Fixes #26101

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2025-05-30 14:47:13 -04:00
775a85004f Add "dest" as an alias for "destination" in --mount
Given I wrote this and I still mess it up on a regular basis, I
cannot be alone in forgetting whether "dst" or "dest" is the
correct short option for "destination". Let's just make both
valid, I don't see a reason not to.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2025-05-30 14:47:13 -04:00
5e4adb661c Merge pull request #26174 from fpoirotte/kube_cpuset_cgroup
Support --cpuset-cpus and --cpuset-mems in podman kube play
2025-05-30 14:37:57 +00:00
398594ea5f Merge pull request #26237 from p12tic/fix-log-tag-priority
specgen/generate: Fix log tag priority
2025-05-30 12:43:04 +00:00
a17f8afbbc specgen/generate: Fix log tag priority
Currently setting log_tag from containers.conf will override any value
set via --log-opt tag=value option. This commit fixes this.

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

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-30 01:37:21 +03:00
3a981915f0 Handle "Entrypoint":[] in compat containers/create API.
When using `docker compose run --entrypoint ''`, docker sends
`"Entrypoint": []` in the JSON. Podman currently treats that
as `nil` and fallback to default image entrypoint.

This is not what is expected by the user. Instead, it should
not use any entrypoint.

This commit fixes it by properly propagating the `[]` downstream
to libpod.

Fixes: #26078

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2025-05-29 08:45:35 +02:00
e98e128012 Merge pull request #26200 from l0rd/win-overlay-vols
Fix overlay volumes on Windows
2025-05-27 14:20:12 +00:00
d667e2fe51 Merge pull request #26202 from Luap99/compat-base-hosts
compat API: respect base_hosts_file containers.conf option
2025-05-27 13:40:23 +00:00
f25cefcb1b Fix overlay volumes on Windows
The Windows source folder path was not converted in the corresponding
machine folder path when the volume was of type overlay as it does for
other bind mount volumes.

Fix #25988

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2025-05-27 15:11:36 +02:00
66bf98e27c compat API: respect base_hosts_file containers.conf option
Hard coding to none without checking containers.conf is not a good idea
as users who liked the previous behavior and the podman default behavior
of keeping the hosts entries can no longer do that.

With this commit they can set base_hosts_file = "/etc/hosts" to restore
the previous behavior.

Fixes: https://issues.redhat.com/browse/RHEL-92995

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-05-26 16:16:10 +02:00
5bfdb25b26 Support --cpuset-<cpus/mems> in podman kube play
This commit adds two new annotations named
io.podman.annotations.cpuset/$ctrname and
io.podman.annotations.memory-nodes/$ctrname

The first one allows restricting a container's execution to specific
CPU cores while the second restricts memory allocations to specific
NUMA memory nodes. They are also added automatically when the
--cpuset-cpus and --cpuset-mems options are used.

Fixes: containers#26172

Signed-off-by: François Poirotte <clicky@erebot.net>
2025-05-22 11:45:01 +02:00
5797c1dd27 pkg/machine: don't use dummy linger service
There is no reason to deifne a dummy service to run sleep just to get
the podman.socket enabled. Enabeling a service is just creating the
symlink so we can do that for the user sessions as well.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-05-21 19:08:41 +02:00
79a857e0a0 pkg/machine: correctly enable lingering
When a custom username is requested we must stil enable lingering for
it. The linger setup in the coreos image with the hard coded core user
doesn't really make sense as it doesn't work when another name is used.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-05-21 19:08:41 +02:00
9872f0e83c Update expected output for a machine copy test
The podman machine copy test "attempt copying file to a new directory"
was failing because on recent version of Windows the error message
doesn't match the expected error message. To make it work on new and
old version of Windows both old and new error messages are now
considered as valid.

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

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2025-05-21 18:40:52 +02:00
af495e1aa9 Replace alpine_nginx with TESTIMAGE in e2e tests
The image quay.io/libpod/alpine_nginx doesn't have a `linux/arm64` version
and the test "Single character volume mount" on Windows ARM64 was
failing. Changing it to TESTIMAGE (quay.io/libpod/testimage) fixes it.

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2025-05-21 18:40:52 +02:00
5629ba8a8d Merge pull request #26149 from azdle/docker-api-container-status
compat: fix ContainerState.Status JSON values
2025-05-20 17:53:12 +00:00
92a15085cb compat: fix Container State.Status JSON values
This mirrors the conversion currently being done in `LibpodToContainer`
into `LibpodToContainerJSON`, converting podman style statuses to docker
style statuses as defined in their OpenAPI definition:

https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Container/operation/ContainerInspect

Fixes: #17728

Signed-off-by: Patrick Barrett <patrick@psbarrett.com>
2025-05-20 10:22:45 -05:00
e32b57b1ea Merge pull request #26115 from inknos/compat-get-info-defaultaddresspool
compat: Add DefaultAddressPools field to GET /info
2025-05-20 14:37:22 +00:00
7c0262db3d compat: Add DefaultAddressPools field to GET /info
Signed-off-by: Nicola Sella <nsella@redhat.com>
2025-05-16 13:16:27 +02:00
265ca77276 Be explicit about ssh configs suitable only for localhost
... and warn loudly against generalization.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2025-05-15 23:04:49 +02:00
5fef6b714d Merge pull request #26116 from inknos/compat-post-containers-create-cgroupsnsmode
compat: Add CgroupnsMode to POST /containers/create
2025-05-15 18:20:38 +00:00
3bf3d869b6 Merge pull request #26127 from martinetd/restart-hooks
podman: remember hooks-dir on restarts
2025-05-15 14:18:30 +00:00
b82f2962c3 compat: Add CgroupnsMode to POST /containers/create
Signed-off-by: Nicola Sella <nsella@redhat.com>
2025-05-15 15:31:16 +02:00
90ee7c86a3 podman: remember hooks-dir on restarts
When podman restarts config values within the Engine are lost.
Add --hook-dirs arguments as appropriate to the cleanup command
so that hooks are preserved on restarts due to the on-restart setting

Tests: add a check that prestart/poststop hooks ran every time after 2
restarts.
`wait_for_restart_count` was re-used to wait for restarts and moved to
helpers file.

Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Fixes: #17935
2025-05-15 14:23:22 +09:00
637c264e2e fix issues found by nilness
The conditions are always true so they can be removed. And in the case
of exportCheckpoint() the scope means addToTarFiles was overwritten and
thus when it looped over it later the slice was always empty.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-05-13 17:20:10 +02:00
a1ac6c33cc Merge pull request #26113 from ygalblum/quadlet-pod-name
Quadlet - restore pod name to not use systemd specifiers
2025-05-12 23:22:28 +00:00
93fd26bc58 Merge pull request #25660 from ver4a/main
Fix parsing of paths for unmask
2025-05-12 16:55:30 +00:00
09d9d3e26b Revert "Quadlet - fix pod name to depend on the name of the generate service"
This reverts commit 4f38c2fea2f945388491c35327d905cba36f8a5b.

Fixes: #26105
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-05-12 09:33:16 -04:00
811aabd3b0 Merge pull request #26079 from mvfc/main
Take WSL path from PATH instead of forcing it to WindowsApps
2025-05-09 13:05:03 +00:00