6991 Commits

Author SHA1 Message Date
683e9b2c94 Merge pull request #26434 from mheon/import_export
Add remote support for `podman volume import` and `podman volume export`
2025-06-25 19:48:14 +00:00
e00dfa606a pkg/machine/e2e: add CVE-2025-6032 regression test
Setup a local web server both for HTTP and HTTPS and make sure the
client rejects the connection and does not try to pull the image.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-25 19:27:45 +02:00
7780e28b45 Merge pull request #26491 from ArthurWuTW/25389
Pod YAML: Add support for `lifecycle.stopSignal`
2025-06-24 19:44:30 +00:00
bfc327a08e Secret create - add ignore option to allow noop
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-06-24 15:43:38 -04:00
844ed8296d Merge pull request #26485 from gumimin/update-latest
cmd/podman: add --latest option to update #26380
2025-06-24 18:15:40 +00:00
f21dacc4fb cmd/podman: add --latest option to update #26380
Allow users to target the most recently created container with
`podman update --latest` (short `-l`). The same option already exists
on many other commands, so this brings update in line with the rest of
the CLI and saves users from typing or looking up the newest container.

Fixes: #26380

Signed-off-by: Hayato Kihara <kai.21banana@gmail.com>
2025-06-24 22:06:26 +09:00
98876454cb Refactor volume import to support the remote client
As with `volume export`, this was coded up exclusively in cmd/
instead of in libpod. Move it into Libpod, add a REST endpoint,
add bindings, and now everything talks using the ContainerEngine
wiring.

Also similar to `volume export` this also makes things work much
better with volumes that require mounting - we can now guarantee
they're actually mounted, instead of just hoping.

Includes some refactoring of `volume export` as well, to simplify
its implementation and ensure both Import and Export work with
readers/writers, as opposed to just files.

Fixes #26409

Signed-off-by: Matt Heon <mheon@redhat.com>
2025-06-23 13:42:22 -04:00
17601aa913 Pod YAML: Add support for lifecycle.stopSignal
The field allows users to specify a custom stop signal (e.g., SIGUSR1) per container.
If defined, it overrides the default stop signal (SIGTERM) or that defined in the image metadata.

Fixes: #25389

Signed-off-by: Arthur Wu <lion811004@gmail.com>
2025-06-23 08:23:31 -04:00
726b506acc machine init: fix tls check
Ensure we verify the TLS connection when pulling the OCI image.

Fixes: CVE-2025-6032

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-23 14:12:55 +02:00
7808625785 Merge pull request #26472 from Luap99/quadlet-nologrus
quadlet: remove indirect logrus import
2025-06-19 19:45:24 +00:00
617cdc4b36 Merge pull request #26466 from nbspsemicolon/quadlet-pod-exitpolicy
pkg/systemd: expose [Pod] ExitPolicy key for pod create --exit-policy
2025-06-19 19:01:13 +00:00
964069326d quadlet: remove indirect logrus import
Reduces quadlet binary size about 170kb.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-19 18:47:40 +02:00
5989370c39 pkg/systemd: expose [Pod] ExitPolicy key for pod create --exit-policy
Add ExitPolicy key to pod quadlets with logic to default to stop.

Docs updated with clarifcation on default value and usage example.

Simple assert added to bats to verify default constraint exists.

Changed argument order in ginkgo basic pod unit test

Signed-off-by: Neil Bailey <nbsp@nbailey.net>
2025-06-18 15:08:31 -04:00
dfd205fa24 Merge pull request #26459 from giuseppe/add-volume-uid-gid
volumes: add new --uid and --gid option
2025-06-18 14:49:51 +00:00
1f9893817b volumes: add new --uid and --gid option
they allow to override the owner of the volume.  Differently from
-o=uid= and -o=gid= they are not passed down to the mount operation.

Closes: https://issues.redhat.com/browse/RHEL-76452

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-06-18 15:33:09 +02:00
6623ab8d17 remove pkg/timetype
This package is no longer used. It was moved to c/common in
659c178c2c

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-17 18:16:24 +02:00
3ef33653ff compat: RepoTags and RepoDigest return [] and not null
Signed-off-by: Nicola Sella <nsella@redhat.com>
2025-06-17 15:43:05 +02:00
f235d47e1d Merge pull request #26308 from kolyshkin/blkdev
podman-update: fix block device handling
2025-06-16 14:46:05 +00:00
63bf454d66 Refactor podman export to work with the remote client
Previously, our approach was to inspect the volume, grab its
mountpoint, and tar that up, all in the CLI code. There's no
reason why that has to be in the CLI - if we move it into
Libpod, and add a REST endpoint to stream the tar, we can
enable it for the remote client as well.

As a bonus, previously, we could not properly handle volumes that
needed to be mounted. Now, we can mount the volume if necessary,
and as such export works with more types of volumes, including
volume drivers.

Signed-off-by: Matt Heon <mheon@redhat.com>
2025-06-14 07:42:38 -04:00
0ab8a3c576 artifact mount: add new name option to specify filename
An artifact without the title annoation just gets the digest as name
which is less than ideal. While it is a decent default to avoid
conflicts users would like to configure the name.

With the name=abc option we will call the file abc in case of a signle
artifact and otherwise we use abc-x where x is the layer index starting
at 0 to avoid conflicts.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-14 12:25:21 +02:00
60859b07b7 Merge pull request #26201 from lstocchi/wsl
fix wsl install workflow on machine init command
2025-06-13 09:43:50 +00:00
1e53cacb08 Merge pull request #26232 from 2004joshua/buildxInspect
podman buildx inspect
2025-06-12 08:02:31 +00:00
3f0cdb9414 pkg/specgen: error out when a block device isn't
In case something other than a block device is supplied, podman proceeds
to apply settings for a block device with the same minor:major.

For example, "--blkio-weight-device /dev/zero:123" (alas, this is taken
literally from podman-update(1) EXAMPLES section) sets blkio weight
for /dev/ram5. Instead, it should error out since /dev/zero is not a
block device.

Add an appropriate check.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-06-10 13:50:02 -07:00
9b6e548387 pkg/specgen: refactor FinishThrottleDevices, WeightDevices
Refactor these functions to
 - avoid repetition of common code (mostly stat of block device path);
 - perform early return if nothing is to be done;
 - remove some excessive nesting.

It also improves some error messages.

This is a preparation for the next commit.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-06-10 13:50:02 -07:00
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