Commit Graph

24426 Commits

Author SHA1 Message Date
Matt Heon 3d344ffd26 In SQLite state, use defaults for empty-string checks
As part of our database init, we perform a check of the current
values for a few fields (graph driver, graph root, static dir,
and a few more) to validate that Libpod is being started with a
sane & sensible config, and the user's containers can actually be
expected to work. Basically, we take the current runtime config
and compare against values cached in the database from the first
time Podman was run.

We've had some issues with this logic before this year around
symlink resolution, but this is a new edge case. Somehow, the
database is being loaded with the empty string for some fields
(at least graph driver) which is causing comparisons to fail
because we will never compare against "" for those fields - we
insert the default value instead, assuming we have one.

Having a value of "" in the database largely invalidates the
check so arguably we could just drop it, but what BoltDB did -
and what SQLite does after this patch - is to use the default
value for comparison instead of "". This should still catch some
edge cases, and shouldn't be too harmful.

What this does not do is identify or solve the reason that we are
seeing the empty string in the database at all. From my read on
the logic, it must mean that the graph driver is explicitly set
to "" in the c/storage config at the time Podman is first run and
I'm not precisely sure how that happens.

Fixes #24738

Signed-off-by: Matt Heon <mheon@redhat.com>
2025-02-11 11:01:00 -05:00
Jan Rodák 2612e3c233 Bump FreeBSD version to 13.4
Version 13.3 is EOL. See https://www.freebsd.org/releases/

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-02-11 09:21:54 -05:00
Paul Holzinger 3d917a395c docs: add v5.4 to API reference
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-02-11 09:21:33 -05:00
openshift-merge-bot[bot] a8a01ca426
Merge pull request #25287 from openshift-cherrypick-robot/cherry-pick-25235-to-v5.4
[v5.4] [skip-ci] RPM: set BUILD_ORIGIN
2025-02-11 07:13:43 +00:00
Lokesh Mandvekar 13ebc5860c Update rpm/podman.spec
Co-authored-by: Paul Holzinger <git@holzinger.dev>
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-02-11 07:10:30 +00:00
Lokesh Mandvekar f34d6c76db RPM: set buildOrigin in LDFLAG
For Copr builds, it will mention the Copr info from where the rpm is
installed.

For non-copr builds, it will mention the value of the packager macro
if set, and skip this field altogether if not.

On local rpm builds, this shows:
```
Build Origin:  Lokesh Mandvekar <lsm5@fedoraproject.org>
```

On koji rpm builds, this shows:
```
Build Origin: Fedora Project
```

On copr rpm builds (for eg. rhcontainerbot/playground), this shows:
```
Build Origin: Copr: rhcontainerbot/playground
```

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2025-02-11 07:10:30 +00:00
openshift-merge-bot[bot] 7839a1ce1b
Merge pull request #25274 from openshift-cherrypick-robot/cherry-pick-24864-to-v5.4
[v5.4] [skip-ci] RPM: cleanup macro defs
2025-02-10 13:38:19 +00:00
Lokesh Mandvekar 6218d42ed6 RPM: cleanup macro defs
The default `gobuild` macro on CentOS Stream 9 now includes support for
`BUILDTAGS`.

CentOS Stream envs now also define `_user_tmpfilesdir` macro by default.
Both these definitions are no longer needed here.

`libtrust_openssl` buildtag is also set in spec wherever relevant.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2025-02-10 13:30:14 +00:00
openshift-merge-bot[bot] e4bfcf9b02
Merge pull request #25258 from openshift-cherrypick-robot/cherry-pick-25252-to-v5.4
[v5.4] Makefile: escape BUILD_ORIGIN properly
2025-02-07 16:36:59 +00:00
Paul Holzinger 18249e10c1 Makefile: escape BUILD_ORIGIN properly
When trying to pass a string with spaces that broke the go command cli
parsing, the full argument must be put in quotes to avoid escaping
issues.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-02-07 15:28:53 +00:00
openshift-merge-bot[bot] fcbce3648c
Merge pull request #25249 from openshift-cherrypick-robot/cherry-pick-25245-to-v5.4
[v5.4] rootless: fix hang on s390x
2025-02-06 16:43:29 +00:00
Giuseppe Scrivano d280feb96c rootless: fix hang on s390x
avoid using the glibc fork() function after using directly the clone()
syscall, as it confuses glibc causing the fork() to hang in some
cases.

The issue has been observed only on s390x, and the fix was confirmed
in the issue discussion.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-02-06 15:22:00 +00:00
openshift-merge-bot[bot] 582d7185df
Merge pull request #25225 from mheon/bump_540_rc3
[CI:ALL] Bump to v5.4.0-RC3
2025-02-05 19:00:15 +00:00
Matt Heon fa263d2cc9 Set Cirrus DEST_BRANCH appropriately to fix CI
Signed-off-by: Matt Heon <mheon@redhat.com>
2025-02-05 08:55:17 -05:00
Matt Heon 0f01f00f03 Bump to v5.4.0-dev
Signed-off-by: Matt Heon <mheon@redhat.com>
2025-02-05 08:55:17 -05:00
Matt Heon ad54787bf0 Bump to v5.4.0-rc3
Signed-off-by: Matt Heon <mheon@redhat.com>
2025-02-05 08:55:17 -05:00
Matt Heon 6c78bad0dd Update release notes for v5.4.0-rc3
Signed-off-by: Matt Heon <mheon@redhat.com>
2025-02-05 08:55:17 -05:00
Ashley Cui 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
Paul Holzinger 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
Paul Holzinger 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
Brent Baude 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
Brent Baude 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
Brent Baude 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
Giuseppe Scrivano 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
Giuseppe Scrivano 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
Federico Di Pierro 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
Jake Correnti 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
openshift-merge-bot[bot] 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
Lokesh Mandvekar 5feb81d9ff RPM: include empty check to silence rpmlint
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2025-02-04 10:57:49 +00:00
Lokesh Mandvekar 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
openshift-merge-bot[bot] 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
Mario Loriedo 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
openshift-merge-bot[bot] 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
openshift-merge-bot[bot] 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
openshift-merge-bot[bot] 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
Paul Holzinger 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
Paul Holzinger 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
tomsweeneyredhat 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
openshift-merge-bot[bot] 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
openshift-merge-bot[bot] 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
Paul Holzinger 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
Paul Holzinger e24ccdd27b libpod: remove unused ExecStartAndAttach()
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-02-03 01:50:55 +00:00
tomsweeneyredhat 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
openshift-merge-bot[bot] 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
Brent Baude 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
openshift-merge-bot[bot] 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
openshift-merge-bot[bot] 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
openshift-merge-bot[bot] 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
Brent Baude 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
Brent Baude 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