Commit Graph

7702 Commits

Author SHA1 Message Date
Brent Baude
320dcc8034 Merge pull request #28775 from Honny1/skip-pesto-tests
Skip pasta forwarder tests pending passt SELinux fix
2026-05-26 08:46:28 -05:00
Paul Holzinger
1c6d8a0a89 Merge pull request #28759 from kolyshkin/modernize-3
Assorted go modernize fixes
2026-05-26 12:20:31 +02:00
Jan Rodák
5b98ee331f Merge pull request #28641 from jiwahn/feat/container-annotation-filter
Feat/container annotation filter
2026-05-26 12:00:40 +02:00
Jan Rodák
751f7c316d Merge pull request #28714 from christopherbii/main
Fix Missing HostConfig field from API response
2026-05-26 10:26:46 +02:00
Jan Rodák
3f427f4535 Skip pasta forwarder tests pending passt SELinux fix
The pasta_t SELinux domain is denied { create } for pasta.sock
on ifconfig_var_run_t directories. Disable all pasta forwarder
tests (BATS + e2e) until a new passt release ships the fix.

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-05-25 12:31:26 +02:00
Kir Kolyshkin
329ce86835 test/e2e: modernize
Generated by go1.26.3 fix ./test/e2e/...

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-05-22 13:11:01 -07:00
Kir Kolyshkin
f45b4c506a ci: replace git-validation with a small shell script
Since commit def70012b9 git-validation is only used to check if the
commit subject is less than 90 characters.

Drop the vendored git-validation Go tool and the .gitvalidation make
target in favor of hack/commit-subject-check.sh.

This removes a Go build dependency and a vendored tree from
test/tools/ while keeping the same CI and local behavior.

Note the now-removed GIT_CHECK_EXCLUDE was not used by gitvalidation
since commit def70012b9 because it was not checking any specific
files, just the commit subject lengths.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-05-22 11:43:59 -07:00
Kir Kolyshkin
7f7b35356f Replace os.Is* error checks with errors.Is
Using os.Is{Exist,NotExist,Permission} checks is not recommended in the
new code (see official documentation). While using it in the existing
code is OK, it may still result in a subtle errors later (for a specific
example of that, see [1]).

Replace those with errors.Is.

Generated by:

	gofmt -r 'os.IsExist(a) -> errors.Is(a, os.ErrExist)' -w .
	gofmt -r 'os.IsNotExist(a) -> errors.Is(a, os.ErrNotExist)' -w .
	gofmt -r 'os.IsPermission(a) -> errors.Is(a, os.ErrPermission)' -w .
	goimports -w .
	git diff vendor test/tools/vendor | patch -p1 -R

[1]: https://github.com/opencontainers/runc/pull/5061
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-05-21 13:09:42 -07:00
Jan Rodák
e598657244 Add pasta-based port forwarding for rootless bridge networks
Add rootless_port_forwarder="pasta" option that uses pesto to update
pasta's forwarding table via UNIX socket, preserving source IPs that
rootlessport's userspace proxy masks.

HostIP is stripped from port mappings in the netavark wrapper when
pasta forwarding is active because pesto handles host-side binding
while pasta's splice changes the destination IP that netavark DNAT
expects. Pesto binds both 0.0.0.0 and [::] for dual-stack support.

Fixes: https://redhat.atlassian.net/browse/RUN-2214
Fixes: https://github.com/containers/podman/issues/8193
Fixes: https://redhat.atlassian.net/browse/RUN-3587

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-05-20 14:24:47 +02:00
Christopher Bii
a53c10ced0 compat API: populate HostConfig in container list response
- Populate the Docker-compatible container summary HostConfig from the
  container inspect data
- Remove the unused ContainerCreateConfig wrapper from the compat
  handler
- Add APIv2 test

Signed-off-by: Christopher Bii <christopherbii@hyub.org>
2026-05-20 03:27:14 -04:00
Paul Holzinger
6f048e6500 inspect: do not show <nil> as gateway
When a network is created without gateway, i.e. --internal --disable-dns
then the gateway will be nil. But converting a nil ip to string produces
"<nil>" which is not what we want as we like an empty string there to
signal that the network has no gateway.

Fixes: #28705

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-05-18 20:47:52 +02:00
Jan Rodák
517070e750 Merge pull request #28673 from kyounghunJang/feat/add-volume-prune-dry-run
volume prune: add dry-run support
2026-05-18 19:26:18 +02:00
Byounguk Lee
b50b9c0dbc events: support artifact events with refactored event forwarding
- libpod/events.go & libpod/runtime.go: Added the `Artifact` event type.
  Refactored and deduplicated event forwarding logic by introducing
  `spawnEventForwarder[T any]`, replacing separate goroutine loops for
  images and artifacts. Implemented graceful shutdown and resolved eventer
  initialization race conditions.
- libpod/events: Implemented event filtering by name/ID, updated journald
  and logfile readers/writers for artifact events, and added `Artifact` to
  `ToHumanReadable` formatting.
- cmd/podman: Added shell auto-completion for `artifact=` and `type=artifact` filters.
- docs/test: Documented the `artifact` event type, statuses, and filters in
  `podman-events.1.md`. Added an end-to-end test in `events_test.go` to verify
  event emissions.

Signed-off-by: Byounguk Lee <nimdrak@gmail.com>
2026-05-18 00:05:10 +00:00
KyounghoonJang
3d899a8c25 volume prune: add dry-run support
Add a --dry-run option to show which volumes would be pruned without removing them.

Related: #27838
Signed-off-by: KyounghoonJang <matkimchi_@naver.com>
2026-05-16 19:03:34 +09:00
Paul Holzinger
96eadb51a4 Merge pull request #28700 from mheon/request_bodies_are_optional
API Handlers should not error on empty request bodies
2026-05-13 23:45:51 +02:00
Matthew Heon
3ac6501fdd API Handlers should not error on empty request bodies
This is a Docker compatibility change discovered while working on
cases it is practically speaking required because there are
mandatory parameters in the body, but in those cases you do not
get a JSON decode error back, you get an error about the field
that needs to be set. I see no reason for us not to match this
convention; it doesn't break our existing bindings, but makes
using the API via curl or similar somewhat easier.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2026-05-13 16:33:40 -04:00
Brent Baude
65bddce16c Merge pull request #28695 from Luap99/test-log
test/system: log socat output in retry loop
2026-05-13 13:48:39 -05:00
Paul Holzinger
82e7fc1440 Merge pull request #28692 from BackSlasher/compat-push-aux-trailer
api: emit aux trailer with manifest digest on image push
2026-05-13 14:47:20 +02:00
Paul Holzinger
f33ef6a77f test/system: log socat output in retry loop
This test is currently flaking with the latest pasta update[1]. As part
of debugging this it was hard to see why socat fails 5 times in this
loop as the run function does not log the output so I had to add an echo
here.

[1] https://bugs.passt.top/show_bug.cgi?id=202

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-05-13 14:38:03 +02:00
nitz
b571943fe4 api: emit aux trailer with manifest digest on image push
The Docker daemon emits a final `{"aux":{"Tag","Digest","Size"}}` JSON
object on the push event stream so clients can recover the registry-side
manifest digest without an extra registry round-trip.

Several Docker-API clients (e.g. the Pulumi and Terraform docker
providers) parse `aux.Digest` to populate their pushed-image outputs.
Without the trailer they either silently fall back to inspecting the
local image (whose digest does not always match what was pushed - see
containers/podman#14779) or emit "Push completed without reporting a
digest" warnings.

`pushReport.ManifestDigest` is already populated with the correct
on-the-wire digest from `manifest.Digest(pushedManifestBytes)`; this
change just wraps it into the same JSON shape Docker emits and adds an
apiv2 test asserting the trailer is present with Tag, Digest, and Size.

Signed-off-by: nitz <nitz.raz@gmail.com>
2026-05-13 13:23:16 +03:00
renovate[bot]
879594a2f9 chore(deps): update dependency requests to ~=2.34.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-11 20:00:35 +00:00
Paul Holzinger
b55ce72592 Merge pull request #27311 from danishprakash/dual-stack-bind
libpod: replace listen with socket+bind for dual-stack port reservation
2026-05-11 14:06:20 +02:00
Jiwoo Ahn
ec583fa17f filters: add annotation filter for containers Fixes: #28562
Signed-off-by: Jiwoo Ahn <ikwydls1314@gmail.com>
2026-05-11 20:24:28 +09:00
Danish Prakash
1a20d82edc libpod: replace listen with socket+bind for dual-stack port reservation
This commit addresses two concerns.

Bind dual stack when hostIP unless it is explicitly specified. Since we
use listen(), this change resulted in blocked connections on stacks
without matching DNAT rules (e.g. connecting to [::1] on an IPv4-only
network) because the TCP handshake on the reservation socket would complete
instead of returning ECONNREFUSED allowing the client to fallback to IPv4.

Replacing listen() with raw socket() and bind() syscalls fixes this by
allowing us to reserve this port without accepting connections; clients
get ECONNREFUSED and fall back to IPv4 automatically, as is desired.

Fixes: https://github.com/containers/netavark/issues/1338

Co-authored-by: Paul Holzinger <pholzing@redhat.com>
Signed-off-by: Danish Prakash <contact@danishpraka.sh>
2026-05-11 13:21:12 +05:30
Ashley Cui
462b24479b Use tmp context dir when building with process substitution
Podman defaults to the directory of the Containerfile when no context dir is explicitly provided.
When running podman build with process subsituiton,  `podman build -f <(echo "FROM scratch")`,
the Containerfile path expands to `/dev/fd/<NUM>`, which makes `/dev/fd` the context dir.
When building, Buildah attempts to create an overlay mount on top of the `/dev/fd` context dir, which fails.

In these cases, use a temp context dir instead: `$TMPDIR/podman-build-context-$randnum`

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

Signed-off-by: Ashley Cui <acui@redhat.com>
2026-05-08 10:39:38 -04:00
iTrooz
f4389592f9 test: ensure complex --output values have correct behaviour
Signed-off-by: iTrooz <hey@itrooz.fr>
2026-05-05 14:19:04 +02:00
Tom Sweeney
3ce0e3e17c Merge pull request #28624 from Honny1/labels
`ps`, `pod ps`, `volume ls`: format labels as comma-separated `key=value` for Docker compatibility
2026-04-30 13:37:14 -04:00
Matt Heon
99b2fe252e Merge pull request #28455 from simonbrauner/fix-filtering-with-negated-labels
Fix filtering with negated labels
2026-04-30 12:08:31 -04:00
Jan Rodák
dc4495ec64 volume ls: format labels as comma-separated key=value strings
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-04-30 18:05:06 +02:00
Jan Rodák
f460bc0ae5 ps: format labels as comma separated key=value for Docker compatibility
Fixes: https://github.com/containers/podman/issues/21847

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-04-30 18:04:49 +02:00
Mario Loriedo
15c9ca130f Add command podman system hyperv-prep
Introducing a new `podmand system` subcommand to prepare a Windows host
to run Hyper-V based Podman machines: `hyperv-prep`.

When executed it:
- creates of the registry keys for VSocks
- adds the current user to the Hyper-V administrators group

This command requires an administrator terminal.

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-04-29 23:00:29 +02:00
Paul Holzinger
3e9fb8b411 Merge pull request #28603 from Luap99/test-rootfs
test/system: fix quadlet - rootfs on kernel 7.1
2026-04-29 19:33:07 +02:00
Šimon Brauner
fdd8cc17fa Fix filtering with negated labels
Signed-off-by: Šimon Brauner <sbrauner@redhat.com>
2026-04-29 11:18:03 +02:00
Paul Holzinger
12d40777f0 test/system: fix quadlet - rootfs on kernel 7.1
As found in fedora openQA testing on the kernel update this test fails
due a selinux denial.

The kernel now correctly checks the backing fs selinux context in all
cases. See kernel commit 82544d36b172 (selinux: fix overlayfs mmap()
and mprotect() access checks).

The test tries to access another container so the selinux level will
be different from the quadlet roofs container and therefore fail to
access the files.

To fix this we should be able to just use the regular image mount which
has a level all containers can access. The comment that this is not
parallel safe is untrue, mounts are reference counted so this should not
get unmounted all of the sudden by another test.

In fact we have another  --rootfs test case where we do this and it
passed in openQA, see "podman run - check workdir".

Fixes: #28602

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-28 21:09:05 +02:00
Lokesh Mandvekar
991cde5167 Merge pull request #28594 from containers/renovate/openapi-schema-validator-0.x
Update dependency openapi-schema-validator to ~=0.9.0
2026-04-28 14:54:05 -04:00
Matt Heon
3bd7bbc0dc Merge pull request #28413 from simonbrauner/issue-26786
Use AND to combine different volume filter keys
2026-04-28 13:59:42 -04:00
Ashley Cui
bb02e49080 Adjust error messages for new netavark create
c/common uses the new netavark create command, so some of the error messages have slightly changed. Adjust the tests so they pass.

Signed-off-by: Ashley Cui <acui@redhat.com>
2026-04-28 12:43:48 -04:00
Paul Holzinger
241e59b9af Merge pull request #28494 from agp8x/fix/keep-pod-hostname
keep pod hostname when a container is stopped
2026-04-28 17:52:39 +02:00
Giuseppe Scrivano
b25a1ec50b Merge pull request #28597 from Luap99/checkpoint
test/e2e: fix broken checkpoint tests
2026-04-28 16:26:17 +02:00
Paul Holzinger
50bf7db0d9 test/e2e: fix broken checkpoint tests
On main these tests fail right now due the parallel merge of commit
d01cd46830 ("test: remove outdated checkpoint skip") and commit
1b99ae56b0 ("New images 2026-04-24").

The new crun and/or criu versions in the CI images changed the error
message so adapt to that.

The new full error is:
Error: crun: (00.054135) Error (criu/cgroup.c:1998): cg: cgroupd: recv req error: No such file or directory: OCI runtime attempted to invoke a command that was not found

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-28 15:27:02 +02:00
Paul Holzinger
c1d4e1491a test/e2e: port some checkpoint tests to PodmanExitCleanly
Also remove one podman rm -t0 -fa call, the test cleanup does it already
so no need to do it twice.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-28 15:27:02 +02:00
Paul Holzinger
2605275eac Merge pull request #28555 from lsm5/tmt-revdep-podman-next
Packit: Fixes for tmt-revdeps test
2026-04-28 13:51:13 +02:00
renovate[bot]
455367165c Update dependency openapi-schema-validator to ~=0.9.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-27 18:58:39 +00:00
Lokesh Mandvekar
61792bd9cd TMT: Remove test/tmt/tmt.fmf
Test fetched from upstream. No need to have it here.

Signed-off-by: Lokesh Mandvekar <lsm5@linux.com>
2026-04-27 12:57:48 -04:00
Paul Holzinger
bd86edcbe1 Merge pull request #28591 from Luap99/vendor
update container-libs vendor and re-enable module command line completion test
2026-04-27 18:12:56 +02:00
Jan Rodák
30f93025ab Merge pull request #28556 from Luap99/checkpoint-skip
test: remove outdated checkpoint skip
2026-04-27 15:02:20 +02:00
Paul Holzinger
f493ef0734 test/system: re-enable module command line completion test
The paths are no exported again in the latest common changes from
 https://github.com/containers/container-libs/pull/790

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-27 12:54:05 +02:00
Clemens Klug
24130e2a0c keep pod hostname when a container is stopped
When a container in a pod is stopped, its container name is removed from /etc/hosts. etchosts.Remove() filters for any entry matching the container name or the pod hostname. A pod with additional host entries like --add-host FQDN;pod-hostname:127.0.0.1 is affected by this deletion, too.

Only the container name needs to be removed when a container is stopped.

Signed-off-by: Clemens Klug <git@agp8x.org>
2026-04-24 10:20:43 +00:00
Paul Holzinger
d01cd46830 test/system: skip podman checkpoint --export, with volumes on aarch64
It fails due some selinux problem, #28576.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-23 20:48:55 +02:00
Paul Holzinger
46aa8b83a4 test: remove outdated checkpoint skip
This should work again with the latest VM images.

Fixes: #26289

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-23 20:44:06 +02:00