Commit graph

17985 commits

Author SHA1 Message Date
Paul Holzinger
d25dadf80a
test/system: speed up podman ps --external
The buildah buil kill trick is bad as we have to sleep and wait to aboid
flakes which takes time. Instead it is possible to redo this build part
manually with buildah commands. It is not trival and harder to
understand but it safes 2-3s so I think it is worth it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-01-19 16:38:51 +05:30
Ed Santiago
4de3360dfd
System tests: safe container/image/volume/etc names
Many system tests use hardcoded names for containers, images,
and everything. This has worked because system tests run
serially. It will not work if we ever run in parallel.

Create a new safename() helper, and use it as follows:

   myctr=c_$(safename)
   myvol1=v1_$(safename)
   ...

Find current instances of hardcoded names, and replace
with safe ones.

Whether or not we ever end up parallelizing system tests,
this is simply good practice.

There are far too many instances to fix in one (reviewable) PR.
This is commit 1 of N.

Signed-off-by: Ed Santiago <santiago@redhat.com>

safename: consistent within same test, and, dashes

Make safename() invocations consistent within the same
test. This puts the onus on the caller to add a unique
element when calling multiple times, e.g. "ctr1-$(safename)".
This is not too much of a burden. Major benefit is making
it easy for a reader to associate containers, pods, volumes,
images within a given test.

And, use dashes, not underscores. "podman generate kube"
removes underscores, making it very difficult to do
things like "podman inspect $podname" (because we need
to generate "$podname_with_underscores_removed")

Signed-off-by: Ed Santiago <santiago@redhat.com>
2026-01-19 16:38:51 +05:30
Lokesh Mandvekar
ec8e61e60a
Fix podman-remote build output not being displayed
The podman-remote build command was not displaying build output, causing
remotesystem tests to fail when expecting output like "COMMIT", "cache",
"Successfully built", etc.

Root causes:
1. BuildOptions.Out was set to nil when no --logfile was specified,
   causing all build output to be discarded
2. BuildOptions.Err was not set, preventing auxiliary build output
   from being displayed

Changes:
- Set Out and Err to default to os.Stdout and os.Stderr respectively
- Both redirect to logfile when --logfile is specified
- Remove incorrect client-side quiet flag handling (already handled
  by build engine via Quiet option)

This matches the behavior of the non-remote build implementation in
build.go and ensures build output is properly streamed from the server
through the bindings to the client's stdout/stderr.

Fixes test failures in make remotesystem for build-related tests.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-19 16:38:44 +05:30
Lokesh Mandvekar
25a9cfa392
Update SELinux test expectations to match main branch
The test was using old expectations that required all containers to
have system_r role. The updated version from main branch correctly
expects that privileged/pid=host/ipc=host/label=disable containers
run with the current user and role, not system_r. This is intentional
behavior to support confined users (see commit 5b7dce8a3d).

This brings the test expectations in line with the actual behavior.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-19 16:38:31 +05:30
Lokesh Mandvekar
0a43c510a8
Fix multiple podman cp issues for podman-remote
This fixes several cp-related issues in podman-remote:
- Enable container-to-container copy support
- Fix symlink expansion for broken symlinks
- Fix cp from /dev/stdin
- Fix directory extraction to non-existent destination
- Add validation for copying directory to file
- Fix trailing slash handling for broken symlinks
- Fix stdin validation and --overwrite flag support
- Require existing directory destination when copying from stdin

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-19 16:38:28 +05:30
Lokesh Mandvekar
7c2eb4006c
Add remote build functionality for podman-remote
This commit adds:
- Remote build implementation (build_remote.go)
- Version command for remote builds (version_remote.go)
- Fix error handling in images_build.go

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-19 16:38:27 +05:30
Lokesh Mandvekar
652ec9578b
Fix run_podman to support exit code with warnings notation (+w)
The test framework was not parsing the '+w' suffix in expected exit
codes (e.g., '0+w' meaning "expect exit code 0 and warnings allowed").
This caused the literal string to be passed as a command argument to
podman, resulting in "unrecognized command" errors.

Added pattern matching for:
- [0-9]+w (single digit with warnings)
- [1-9][0-9]+w (double digit with warnings)
- [12][0-9][0-9]+w (triple digit with warnings)

The '+w' suffix is stripped off and only the numeric exit code is used
for validation. Note: The actual warning validation is not implemented
yet, but this allows tests using the '+w' notation to run correctly.

This fixes the "podman-remote: non-default connection" test failure.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-19 16:38:16 +05:30
Lokesh Mandvekar
8fd34d5bfd
Add build-tagged splits for cp command to support podman-remote
The original cp.go uses buildah/copier which depends on libimage,
making it unavailable in remote builds. This change splits cp
implementation into separate local and remote variants:

- cmd/podman/containers/cp.go: Shared command definitions, flags, and
  init function (no build tag)
- cmd/podman/containers/cp_local.go: Local implementation using
  buildah/copier (//go:build !remote)
- cmd/podman/containers/cp_remote.go: Remote implementation using
  stdlib archive/tar (//go:build remote)

The remote implementation:
- Uses ContainerEngine interface methods that work over REST API:
  ContainerStat, ContainerCopyToArchive, ContainerCopyFromArchive
- Properly handles file and directory copying in both directions
- Uses CopyOptions.Rename for file renaming when copying to specific
  filenames
- Returns error for container-to-container copying (not supported with
  podman-remote)

This follows the same pattern used for other libimage-dependent code
in commit 4231526e18.

Fixes system tests that require cp functionality with podman-remote.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-14 19:28:30 +05:30
Lokesh Mandvekar
ca1a0db4e7
Fix userns=auto failures in rootless mode
This commit fixes three related issues that prevented userns=auto from
working correctly in rootless containers:

1. Fix setgroups() error with userns=auto
   When using userns=auto, supplementary GIDs from the container image
   were being passed to setgroups() before user namespace mappings were
   allocated by storage, causing EINVAL errors. Added a check in
   container_internal_common.go to skip supplementary groups when
   AutoUserNs is enabled but GIDMap isn't populated yet.

2. Fix ID mapping allocation bug in storage.go
   CreateContainerStorage was returning empty UID/GID mappings from the
   input options parameter instead of the allocated mappings from the
   storage container object, causing containers to fail with "readlink:
   No such file or directory" errors. Changed the return statement to
   use container.UIDMap and container.GIDMap.

3. Add workaround for containers/storage v1.51.0 bug
   The vendored storage library has a bug in parseMountedFiles where
   groupFile path is incorrectly used as a directory path. Set an
   explicit Size=65536 in AutoUserNsOpts to bypass the buggy code path.

With these fixes, all userns=auto tests in 170-run-userns.bats now pass
in rootless mode.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-14 19:28:30 +05:30
Lokesh Mandvekar
141e6cddfa
[TEST] Fix image events system test for non-deterministic event ordering
The events file backend writes events as they're generated, which may
not match chronological order due to race conditions during concurrent
operations in rmi -f. The remove and untag events from rmi can appear
in any order in the events file.

This matches the approach used in main branch (see commit 111a4bbe71)
which recognizes that event ordering is not guaranteed for concurrent
operations, especially in podman-remote.

This fix:
- Simplifies initial validation to check for event presence (not order)
- Checks deterministic events (0-6) in exact order
- Validates rmi events (7-9) are present without requiring specific order
- Checks final event (10) is the second loadfromarchive
- Does NOT modify runtime code to enforce ordering (events remain as-generated)

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-14 19:28:15 +05:30
Lokesh Mandvekar
650b46a368
Fix runtime initialization for missing StaticDir and VolumePath
This commit fixes two issues in runtime initialization that occur when
vendor code doesn't properly set StaticDir and VolumePath defaults:

1. Add defensive initialization for StaticDir and VolumePath
   - Check if StaticDir is empty and set it to GraphRoot/libpod
   - Check if VolumePath is empty and set it to GraphRoot/volumes
   - This works around missing initialization in older vendor code
     without requiring changes to the vendor directory

2. Fix database initialization to allow creating new bolt_state.db
   - Previously, getDBState() would fail if bolt_state.db didn't exist
   - Now, only return error if it's not os.ErrNotExist
   - This allows NewBoltState() to create the database on first run

These changes resolve the "creating runtime static files directory:
mkdir : no such file or directory" error that occurred when running
podman commands.

Tested with:
- podman ps, info, version commands work correctly
- Volume operations create volumes at correct path
- Database is properly initialized on first run

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-12-18 15:55:40 -05:00
Lokesh Mandvekar
4231526e18
Add build-tagged splits for libimage-dependent code
The common v0.57.7 vendor bump added !remote build tags to libimage,
causing podman-remote builds to fail. This change splits files that
use libimage into separate _local and _remote variants:

- pkg/specgen/specgen_{local,remote}.go: Image field storage and methods
- pkg/api/handlers/types_local.go: ImageDataToImageInspect function
- cmd/podman/utils/error_local.go: ExitCodeFromBuildError function

This allows type definitions to be shared between remote and local
builds while keeping libimage-dependent implementations local-only.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-12-18 10:27:49 -05:00
tomsweeneyredhat
b80a4693c2 [v4.4.1-rhel] Bump Fedora to 41 in .cirrus.yml
We require GO 1.22, and it looks like Fedora 37
tops out at 1.19.  Bump the Fedora to F41.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-12-17 15:40:02 -05:00
Tim Zhou
944d67c642 [v4.4.1-rhel] rotate aws meta_task keys
Signed-off-by: Tim Zhou <tizhou@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-12-17 15:40:02 -05:00
Tim Zhou
86a1ef3a20 [v4.4.1-rhel] rotate aws key
Signed-off-by: Tim Zhou <tizhou@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-12-17 15:40:01 -05:00
tomsweeneyredhat
e035eb4ffa [v4.4-rhel] Adjust for common bump
The vendoring of Buildah dragged in a bump of common from v0.51.4 to
v0.57.7 which contained many changes to variable and function names.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-12-17 15:40:01 -05:00
Chetan Giradkar
6597a24d6c [v4.4.1-rhel] Change priority for cli-flags for remotely operating
... Podman
cli flags couldn't override the active-destination when env variables were set. As a remedy, the precedence of cli flags has been changed.

Note: This commit is from #19997 and it brought in some pretty massive changes
to how the remote connections are created.

Signed-off-by: Chetan Giradkar <cgiradka@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-12-17 15:40:01 -05:00
Paul Holzinger
9b1c32869f [v4.4-rhel] replace deprecated selinux/label calls
These functions were removed in github.com/opencontainers/selinux
v1.12.0.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-12-17 15:40:01 -05:00
tomsweeneyredhat
2e8bce201e [v4.4.1-rhel] Bump runc to 1.2.9, Buidah 1.29.6
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-12-17 15:39:55 -05:00
openshift-merge-bot[bot]
0b1a1e3275
Merge pull request #27034 from TomSweeneyRedHat/dev/tsweeney/CVE-2025-9566-v4.4.1-rhel
[v4.4.1-rhel] CVE-2025-9566 Fixes
2025-09-10 09:24:55 +00:00
tomsweeneyredhat
be8c3c83cd [v4.4.1-rhel] Bump securejoin to v0.4.1
This is needed for the fixes that are part of the
ones in the CVE-2025-9566 fix.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-09-09 20:03:19 -04:00
Paul Holzinger
0cdddfa8f7 [v4.4.1-rhel] test/e2e: add CVE-2025-9566 regression test
Ensure we do not regress again.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-09-09 20:03:19 -04:00
Paul Holzinger
b026d9272c [v4.4.1-rhel] kube play: don't follow volume symlinks onto the host
For ConfigMap and Secret kube play volumes podman populates the data
from the yaml. However the volume content is not controlled by us and we
can be tricked following a symlink to a file on the host instead.

Fixes: CVE-2025-9566

Fixes: https://issues.redhat.com/browse/RHEL-113150,
https://issues.redhat.com/browse/RHEL-113143,
https://issues.redhat.com/browse/OCPBUGS-61271, https://issues.redhat.com/browse/OCPBUGS-61267

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-09-09 20:00:21 -04:00
openshift-merge-bot[bot]
25da95a585
Merge pull request #26634 from cevich/v4.4.1-rhel_add_release_test
[v4.4.1-rhel] Add conditional release-checking system test
2025-07-30 19:29:35 +00:00
Chris Evich
b41aaa9972
[v4.4.1-rhel] Add conditional release-checking system test
Unfortunately on a number of occasions, Podman has been released
officially with a `-dev` suffix in the version number.  Assist in
catching this mistake at release time by the addition of a simple
conditional test.  Note that it must be positively enabled by a
magic env. var. before executing the system tests.

Ref. original PR: https://github.com/containers/podman/pull/26540

Signed-off-by: Chris Evich <cevich@redhat.com>
2025-07-14 12:30:16 -04:00
openshift-merge-bot[bot]
bdd4a5f15a
Merge pull request #25627 from cevich/unbreak_v441-actual-rhel_ci
[v4.4.1-rhel] Partially revert f8bca0f
2025-03-21 14:08:49 +00:00
Chris Evich
1ca79bdbaf
Re-vendor golang.org/x/crypto from temp. source
This commit re-vendors the module from a temporary source, and moves to
an earlier, patched version to address CVE-2025-22869.  Prior to this
commit, building podman fails due to platform dependence on golang 1.18
- the version currently used to build for RHEL.

In the future, it is intended that the RHEL platform will migrate to a
newer golang toolchain.  This will enable re-vendoring the crypto module
again back to the authoritative upstream source.  Thus removing the need
for the temporary fork.

Resolves: RHEL-81300 RHEL-81322

Signed-off-by: Chris Evich <cevich@redhat.com>
2025-03-21 09:16:15 -04:00
Chris Evich
03b53d3d59
Partially revert f8bca0f
The Fedora-37 CI VMs used prior to f8bca0f closely matched RHEL-8.8
which is the intended destination of this v4.4.1-rhel release branch.
Importantly this change, along with one or more future commits
(53a8ef8..b9110a1) lead to downstream build failures on RHEL 8.8,
and reproduce using the original Fedora-37 CI VMs. In other words,
leaving the F37 CI VMs in place would have allowed these failures
to be caught during upstream rather than downstream testing.

Signed-off-by: Chris Evich <cevich@redhat.com>
2025-03-19 11:09:00 -04:00
openshift-merge-bot[bot]
b9110a122f
Merge pull request #25578 from Luap99/v4.4.1-rhel-crypto
[v4.4.1-rhel] CVE-2025-22869: replace crypto with github.com/openshift/golang-crypto@v0.33.openshift.1
2025-03-17 17:29:56 +00:00
Paul Holzinger
0d24dfef44
vendor: replace crypto with github.com/openshift/golang-crypto@v0.33.openshift.1
The go 1.23 build requirement is to new for the older branches, switch
to a fork maintained by openshift.

Fixes: CVE-2025-22869
Fixes: https://issues.redhat.com/browse/RHEL-81322
Fixes: https://issues.redhat.com/browse/RHEL-81300
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-03-13 17:41:35 +01:00
Paul Holzinger
4218941608
Revert "vendor: bump to golang.org/x/crypto@v0.36.0"
This reverts commit 53a8ef8264.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-03-13 17:41:27 +01:00
openshift-merge-bot[bot]
a39f9501cf
Merge pull request #25541 from Luap99/v4.4.1-rhel-crypto
[v4.4.1-rhel] CVE-2025-22869: bump to golang.org/x/crypto@v0.36.0
2025-03-12 08:47:15 +00:00
Paul Holzinger
2c7ea37cd9
cirrus: remove CI_DESIRED_NETWORK check
We only build test and it is not set anymore.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-03-11 19:46:25 +01:00
Paul Holzinger
519e649614
cirrus: remove UBUNTU_NAME
We don't use it and set in in the cirrus.yml anymore.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-03-11 19:38:17 +01:00
Paul Holzinger
53a8ef8264
vendor: bump to golang.org/x/crypto@v0.36.0
Fixes: CVE-2025-22869
Fixes: https://issues.redhat.com/browse/RHEL-81322
Fixes: https://issues.redhat.com/browse/RHEL-81300
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-03-11 19:18:38 +01:00
Paul Holzinger
f8bca0fe45
cirrus: only run single build
Update cirrus.yml to the latest image based of 5.4-rhel, then disable
validate as there no point for it when we do backports. And only
perform a single build on the f41.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-03-11 19:18:33 +01:00
openshift-merge-bot[bot]
65e9d1f67a
Merge pull request #25255 from TomSweeneyRedHat/dev/tsweeney/buildah-1.29.5-v4.4.1-rhel
[v4.4.1-rhel] CVE-2024-11218 Fix
2025-02-07 10:41:25 +00:00
tomsweeneyredhat
0b9f534a2b [v4.4.1-rhel] CVE-2024-11218 Fix
This fixes CVE-2024-11218 by vendoring in Buidlah v1.29.5 which
has the actual fixes within it.

Fixes: https://issues.redhat.com/browse/OCPBUGS-44538,
https://issues.redhat.com/browse/OCPBUGS-44537,
https://issues.redhat.com/browse/OCPBUGS-44539,
https://issues.redhat.com/browse/RHEL-67603, https://issues.redhat.com/browse/RHEL-67597

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-02-06 18:50:21 -05:00
openshift-merge-bot[bot]
c0aafc4a58
Merge pull request #24360 from Luap99/cirrus-remove-tests-4.4
[v4.4.1-rhel] cirrus: remove functional tests
2024-10-24 17:42:36 +00:00
Paul Holzinger
0245907b7c
cirrus: remove functional tests
As discussed at the cabal October 8, 2024 we have no need for these
tests on RHEL branches. The work to maintain them is higher than it is
worth it. We also do not test RHEL but rather some outdated frozen
fedora image build from the time we created the branch.

Therefore we gain little value from them especially as all the internal
Red Hat QE is testing it anyways again on the proper RHEL builds.

So simply delete all the stuff we no longer need:
 - alt builds, no point in windows/macos testing and other arches
 - all the functional tests
 - the build success task (not needed as there is nothing after it
   anymore)
 - the swagger task, we do not use the swagger from the rhel branches

Fixes: https://issues.redhat.com/browse/RUN-2315

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-24 16:23:09 +02:00
openshift-merge-bot[bot]
869aba4a76
Merge pull request #24313 from dashea/CVE-2024-9675-buildah-revendor
[v4.4.1-rhel] Update buildah for CVE-2024-9675
2024-10-22 09:08:40 +00:00
David Shea
638400242d [v4.4.1-rhel] Update buildah for CVE-2024-9675
Addresses:
https://issues.redhat.com/browse/RHEL-62386
https://issues.redhat.com/browse/RHEL-62377

[NO NEW TESTS NEEDED]

Signed-off-by: David Shea <dshea@redhat.com>
2024-10-18 13:37:25 -04:00
openshift-merge-bot[bot]
55fc954493
Merge pull request #24017 from TomSweeneyRedHat/dev/tsweeney/v4.4.1-rhel-cve-2024-3727
[v4.4.1-rhel] CVE-2024-3727 & stats
2024-09-19 22:49:11 +00:00
tomsweeneyredhat
2c2d84f2b7 [v4.4.1-rhel] CVE-2024-3727 & stats
Addresses CVE-2024-3727 and Podman stats takes pagecache into account

Fixes: https://issues.redhat.com/browse/OCPBUGS-37008
       https://issues.redhat.com/browse/OCPBUGS-37010
       https://issues.redhat.com/browse/OCPBUGS-37011

Also addresses #1642 in the v4.4.1-rhel branch

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

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-09-19 12:07:38 -04:00
openshift-merge-bot[bot]
85c2a4fb32
Merge pull request #23266 from TomSweeneyRedHat/dev/tsweeney/accel244-v4.4.1-rhel
[v4.4.1-rhel] builds try to write to additionalImageStore
2024-07-22 19:22:13 +00:00
tomsweeneyredhat
a90356fd8d [v4.4.1-rhel] builds try to write to additionalImageStore
... read-only locataion

This vendors in c/storage v1.45.7 to address this issue in RHEL 8.8/9.2: containers/storage#1733

This addresses: https://issues.redhat.com/browse/RHEL-41079 and https://issues.redhat.com/browse/ACCELFIX-243

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-07-22 11:27:54 -04:00
Paul Holzinger
f134850763 [v4.4.1-rhel] test/system: fix mount external container test
Checking for the mountdir is not relevent, a recent c/storage change[1] no
longer deletes the mount point directory so the check will cause a false
positive. findmnt exits 1 when the given path is not a mountpoint so
let's use that to check.

[1] 3f2e81abb3

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-22 11:27:54 -04:00
tomsweeneyredhat
32c1c30af0 [v4.4.1-rhel] Change images_test expect from 10 to 9
I'm not exactly sure what is happening here, but this call
```
result := podmanTest.Podman([]string{"images", "-q", "-f", "reference=quay.io/libpod/*"})
```
in the test/e2e/images-test.go in this test
```
It("podman images filter reference", func()
```

is now sending back 10 instead of 9 objects.  This was a change
that @edsantiago also made in https://github.com/containers/podman/pull/21356

After the other adjustments I made to the tests to right them,
this seemed to be the last issue.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2024-07-20 16:50:49 -04:00
Ed Santiago
54326f49e4 [v4.4.1-rhel] CI: stop using registry.k8s.io
It's flaky.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-20 16:44:53 -04:00
Sohan Kunkerkar
cbe3e18798 [v4.4.1-rhel] *: migrate image registry to registry.k8s.io
This change is a part of the bigger umbrella issue: https://github.com/kubernetes/k8s.io/issues/4780
Currently, we need this change to get in https://github.com/cri-o/cri-o/pull/6742,
which is failing in CI due to inconsistent vendoring.

Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
2024-07-20 16:44:53 -04:00