24409 Commits

Author SHA1 Message Date
02eac2979c Add BuildOrigin field to podman info
BuildOrigin is a field that can be set at build time by packagers. This helps us trace how and where the binary was built and installed from, allowing us to see if the issue is due to a specfic installation or a general podman bug. This field shows up in podman version and in podman info when populated. Note that podman info has a new field, Client, that only appears when running podman info using the remote client.

Automatically set the BuildOrigin field when building the macOS pkginstaller to pkginstaller.

Usage: make podman-remote BUILD_ORIGIN="mypackaging"

Signed-off-by: Ashley Cui <acui@redhat.com>
2025-02-04 15:17:24 -05:00
141eae99b8 artifact: only allow single manifest
Allowing for multiple manifest per artifact just makes the code and cli
design harder to work with it. It is not clear how mounting, extracting
or edit on a multi manifest artifact should have worked.

A single manifest should make the code much easier to work with.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-02-04 15:13:00 -05:00
d5989990d5 test/e2e: improve write/removeConf()
First use proper ginkgo error handling to ensure errors are actually
reported and fail the test. Mark it as helper function to have better
stack traces.

Then use a atomic write function to prevent issues with partial written
files. I think this is causing CI flakes[1].

Lastly fix the file permissions, do not make it world writable and do
not set the executable bit on the file.

[1] https://api.cirrus-ci.com/v1/artifact/task/5985244932734976/html/int-podman-fedora-41-root-host-sqlite.log.html#t--Podman-network-podman-network-ID-test--1

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-02-04 15:13:00 -05:00
522f9de9e3 Add --noheading to artifact ls
like images and containers, it could be handy to have a --noheading
option that removes the headings on the output.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-02-04 15:13:00 -05:00
9e83191c8f Add --no-trunc to artifact ls
added a --no-trunc flag to artifact ls, which follows what images has
done.  by default now, the ls output will have the shortened 12
character digest.  the --no-trunc will output the full digest.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-02-04 15:13:00 -05:00
4cd76ef27b Add type and annotations to artifact add
podman artifact add now supports two new command line switches.

--type string that describes the type of artifact
--annotation string slice in the form of key=val

These new options allow users to "tag" information in on their artifacts
for any number of purposes down the line

RUN-2446

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-02-04 15:13:00 -05:00
bc8124fd62 pkg/api: honor cdi devices from the hostconfig
pass down the devices specifies in the resources block so that CDI
devices in the compose file are honored.

Tested manually with the following compose file:

services:
  testgpupodman_count:
    image: ubuntu:latest
    command: ["nvidia-smi"]
    profiles: [gpu]
    deploy:
      resources:
        reservations:
          devices:
          - driver: nvidia
            count: 1
            capabilities: [gpu]
  testgpupodman_deviceid:
      image: docker.io/ubuntu:latest
      command: ["nvidia-smi"]
      deploy:
        resources:
          reservations:
            devices:
            - driver: cdi
              device_ids: ['nvidia.com/gpu=all']
              capabilities: [gpu]

Closes: https://github.com/containers/podman/issues/19338

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-02-04 15:13:00 -05:00
57b9709b69 util: replace Walk with WalkDir
Closes: https://github.com/containers/podman/issues/25163

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-02-04 15:13:00 -05:00
bc5de3dfc7 fix(pkg/rootless): avoid memleak during init() contructor.
`argv[0]`, ie: the full buffer allocated by `get_cmd_line_args`,
was going to be freed only if `can_use_shortcut()` was called.
Instead, let `init()` always manage `argv0` lifecycle.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2025-02-04 15:13:00 -05:00
8ee7b117b6 Add machine init --playbook
Allow the user to provide an Ansible playbook file on init which will
then be run on boot.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-02-04 13:34:16 -05:00
4cd60c063c Merge pull request #25217 from openshift-cherrypick-robot/cherry-pick-24748-to-v5.4
[v5.4] [skip-ci] RPM: no qemu on RHEL
2025-02-04 11:20:56 +00:00
5feb81d9ff RPM: include empty check to silence rpmlint
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2025-02-04 10:57:49 +00:00
48459db076 RPM: adjust qemu dependencies
We only need qemu-system-[x86|aarch64]-core based on the architecture
along with qemu-img. So, there's no need to pull in all of qemu.

The qemu-system-[x86|aarch64]-core packages are not present on CentOS
Stream and RHEL, so we use qemu-kvm there instead.

Ref: https://github.com/containers/podman/pull/24369/files#r1883658262

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2025-02-04 10:57:49 +00:00
523e1897a4 Merge pull request #25214 from openshift-cherrypick-robot/cherry-pick-25202-to-v5.4
[v5.4] Force use of iptables on Windows WSL
2025-02-04 10:56:15 +00:00
9b67d4c285 Force use of iptables on Windows WSL
This is a workaround for #25201 and helps with
upgrading the WSL image to Fedora 41.

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2025-02-04 09:00:56 +00:00
95b678b594 Merge pull request #25210 from openshift-cherrypick-robot/cherry-pick-25203-to-v5.4
[v5.4] update gvproxy version
2025-02-03 19:51:27 +00:00
a920fb36dd Merge pull request #25211 from openshift-cherrypick-robot/cherry-pick-25206-to-v5.4
[v5.4] rpm: add attr as dependency for podman-tests
2025-02-03 19:18:42 +00:00
1f7a61513d Merge pull request #25208 from TomSweeneyRedHat/dev/tsweeney/v5.4_buildah_1_39_0
[v5.4] Bump Buildah to v1.39.0
2025-02-03 18:59:20 +00:00
cadf081554 rpm: add attr as dependency for podman-tests
Since commit 06c103469d we are using getfattr in system tests, that
caused failures in gating tests[1] as getfattr was not installed. So add
attr as dependency.

[1] https://artifacts.dev.testing-farm.io/d93b6849-e526-46e9-a7c3-874bad4217a9/work-tests.yml8_p4nfkf/tests-n75vnz0u/test.podman-root.bats.log

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-02-03 18:57:07 +00:00
d4f5817862 update gvproxy version
The current macos installer gvproxy version has a number of issues
around dns handling[1,2]. They should be fixed now in 0.8.3 as they
reverted the dns changes back to the 0.7.5 code. This should make it
work like it used to be. Our 5.3.2 installer ships the 0.7.5 version so
users of the podman installer never noticed that but we got plenty of
reports from brew users. This needs to be backported into v5.4 to make
sure we do not ship the broken version as part of the installer.

[1] https://github.com/containers/gvisor-tap-vsock/issues/462
[2] https://github.com/containers/gvisor-tap-vsock/issues/466

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-02-03 18:51:51 +00:00
fe02e390af [v5.4] Bump Buildah to v1.39.0
Bump Buildah to v1.39.0 in preparation for Podman v5.4.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-02-03 11:55:28 -05:00
2a00ee8f5a Merge pull request #25187 from TomSweeneyRedHat/dev/tsweeney/v5.4_common_0_62_0
[v5.4] Bump c/storage to v1.57.1, c/image v5.34.0, c/common v0.62.0
2025-02-03 10:19:43 +00:00
97432e5bd5 Merge pull request #25197 from openshift-cherrypick-robot/cherry-pick-25180-to-v5.4
[v5.4] podman exec: correctly support detaching
2025-02-03 09:34:59 +00:00
9e2e7f2a77 podman exec: correctly support detaching
podman exec support detaching early via the detach key sequence. In that
case the podman process should exit successfully but the container exec
process keeps running.

Now I wrote automated test for both podman run and exec detach but this
uncovered several larger issues:
 - detach sequence parsing is broken[1]
 - podman-remote exec detach is broken[2]
 - detach in general seems to be buggy/racy, seeing lot of flakes that
   fail to restore the terminal and get an EIO instead, i.e.
   "Unable to restore terminal: input/output error"

Thus I cannot add tests for now but this commit should at least fix the
obvoius case as reported by the user so I like to get this in regardless
and I will work through the other issues once I have more time.

Fixes #24895

[1] https://github.com/containers/common/pull/2302
[2] https://github.com/containers/podman/issues/25089

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-02-03 01:50:55 +00:00
e24ccdd27b libpod: remove unused ExecStartAndAttach()
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-02-03 01:50:55 +00:00
25674e05cd [v5.4] Bump c/storage to v1.57.1, c/image v5.34.0, c/common v0.62.0
If not already bumped, this will bump:

c/storage v1.57.1
c/image v5.34.0
c/common v0.62.0

in preparation for Podman v5.4 and beyond.

Buildah will be vendored in a separate PR.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-01-31 18:36:06 -05:00
c211617cad Merge pull request #25167 from openshift-cherrypick-robot/cherry-pick-25155-to-v5.4
[v5.4] Move detection of libkrun and intel
2025-01-30 17:05:07 +00:00
5f6adf4d80 Move detection of libkrun and intel
A review comment post merge suggested I move the detection of libkrun and intel into the provider.Get()

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-01-30 15:37:47 +00:00
b6775e4637 Merge pull request #25166 from openshift-cherrypick-robot/cherry-pick-25139-to-v5.4
[v5.4] Prevent  multiple machines running on different providers on darwin
2025-01-30 13:30:35 +00:00
c13ef1797f Merge pull request #25160 from mheon/bump_540_rc2
[CI:ALL] Bump to v5.4.0-RC2
2025-01-30 13:27:50 +00:00
fa2f2b0f75 Merge pull request #25156 from openshift-cherrypick-robot/cherry-pick-25151-to-v5.4
[v5.4] Safer use of `filepath.EvalSymlinks()` on Windows
2025-01-30 13:08:40 +00:00
599da8c50b Prevent two podman machines running on darwin
As issue #25112 points out, it was possible to start a machine on one of the darwin providers and then switch providers and start another one with a different name.  This PR firstly prevents that use which is a forbidden use case.

Secondarily, performed some minor cleanup on the error messages being used so that the error would be specific to this condition.

This bug fix is for darwin only.  In the case of Windows, we probably need to answer the question I raised in #24067 first, which is whether we want to stop allowing WSL to run multiple machines.

Fixes #25112

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-01-30 11:19:32 +00:00
03b100563e Remove unnecessary error handling
A function in the reset code does not return an error.  Simply removing the error variable and check for the condition (which was always false or nil)

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-01-30 11:19:32 +00:00
bba28688f7 Remove usused Kind() function
The Kind() exported function is unused in our code; moreover, the function cannot be accurate because in the case of darwin, applehv and libkrun use the same config in the struct and therefore, we cannot identify the provider via that method.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-01-30 11:19:32 +00:00
d475b48766 Bump to v5.4.0-dev
Signed-off-by: Matt Heon <mheon@redhat.com>
2025-01-29 16:14:29 -05:00
14f6a69dd3 Bump to v5.4.0-rc2
Signed-off-by: Matt Heon <mheon@redhat.com>
v5.4.0-rc2
2025-01-29 16:14:29 -05:00
d52277db75 Update release notes for v5.4.0-rc2
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2025-01-29 16:14:29 -05:00
7c3c3d3dd1 Merge pull request #25148 from openshift-cherrypick-robot/cherry-pick-25146-to-v5.4
[v5.4] error with libkrun on intel-based machines
2025-01-29 19:01:18 +00:00
fa0e8f0582 Safer use of filepath.EvalSymlinks() on Windows
The behavior of function `path/filepath.EvalSymlinks()` has
changed in Go v1.23:

- https://go-review.googlesource.com/c/go/+/565136
- https://go.dev/doc/go1.23#minor_library_changes
- https://tip.golang.org/doc/godebug

As a consequences, starting with Podman 5.3.0, when installing
on Windows (WSL) using scoop, Podman fails to start because it
fails to find helper binaries. Scoop copies Podman binaries in
a folder of type Junction and `EvalSymlinks` returns an error.
The problem is described in #24557.

To address this problem we are checking if a path is a `Symlink`
before calling `EvalSymlinks` and, if it's not (hardlinks, mount
points or canonical files), we are calling `path/filepath.Clean`
for consistency. In fact `path/filepath.EvalSymlinks`, after
evaluating a symlink target, calls `Clean` too.

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2025-01-29 16:05:06 +00:00
1c111eead7 error with libkrun on intel-based machines
libkrun is not supported on Intel.  We should error.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-01-29 08:23:47 +00:00
c6fe3b575b Merge pull request #25141 from containers/renovate/pytest-8.x
chore(deps): update dependency pytest to v8.3.4
2025-01-28 15:54:27 +00:00
14cd6ff1d2 chore(deps): update dependency pytest to v8.3.4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-28 14:32:40 +00:00
4ea199d744 Merge pull request #25111 from hdub-tech/docs/podman-build-secrets
Improve podman build secrets docs / Makefile validatepr description
2025-01-28 14:31:51 +00:00
92bce4fd80 Merge pull request #25135 from l0rd/win-installer-block-351-upgrade
Avoid upgrading from v5.3.1 on Windows
2025-01-28 12:11:35 +00:00
dedbea55fb Merge pull request #25130 from Luap99/vendor
vendor latest c/{buildah,common,image,storage}
2025-01-28 10:24:23 +00:00
97323a691a test/buildah-bud: skip two new problematic tests on remote
They are new and failing on remote, needs to be looked at (#25138)
For now skip them so we can have a proper buildah vendored for rc2.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-01-27 20:04:52 +01:00
eea2866a09 Merge pull request #25133 from lsm5/rawhide-selinux-system-test
system-tests: switch ls with getfattr for selinux tests
2025-01-27 19:04:05 +00:00
aa1cf0201c Merge pull request #25134 from andrew-sayers/patch-3
Fix podman-restart.service when there are no containers
2025-01-27 16:54:51 +00:00
8d65d1e9e2 Merge pull request #25102 from Honny1/prune
Clean up after unexpectedly terminated build
2025-01-27 16:52:06 +00:00
527a51dcc4 Fix podman-restart.service when there are no containers
If no containers need to be restarted, podman-restart prints "Error: you must provide at least one name or id" then fails.

Update the service file to handle start and stop symmetrically.

See discussion in https://github.com/containers/podman/pull/25131

Signed-off-by: Andrew Sayers <andrew-github.com@pileofstuff.org>
2025-01-27 14:53:35 +00:00