Commit graph

7642 commits

Author SHA1 Message Date
Matt Heon
c1922ea665
Merge pull request #29762 from madhoshyagnik/fix-quadlets-multipart
pkg/api/handlers/libpod: close quadlets multipart files per iteration and prevent duplicates
2026-09-16 10:05:15 -04:00
Jan Rodák
525dfd8700
Merge pull request #29758 from haneul-24/fix/api-endpoint-content-type
Some checks are pending
ci / int local rootless fedora-prior (push) Blocked by required conditions
ci / sys local rootless fedora-prior (push) Blocked by required conditions
ci / int remote root fedora-prior (push) Blocked by required conditions
ci / sys remote root fedora-prior (push) Blocked by required conditions
ci / int local root fedora-rawhide (push) Blocked by required conditions
ci / sys local root fedora-rawhide (push) Blocked by required conditions
ci / int local rootless fedora-rawhide (push) Blocked by required conditions
ci / sys local rootless fedora-rawhide (push) Blocked by required conditions
ci / int remote root fedora-rawhide (push) Blocked by required conditions
ci / sys remote root fedora-rawhide (push) Blocked by required conditions
ci / apiv2 root fedora-current (push) Blocked by required conditions
ci / bindings root fedora-current (push) Blocked by required conditions
ci / compose_v2 root fedora-current (push) Blocked by required conditions
ci / docker_py root fedora-current (push) Blocked by required conditions
ci / unit root fedora-current (push) Blocked by required conditions
ci / apiv2 rootless fedora-current (push) Blocked by required conditions
ci / compose_v2 rootless fedora-current (push) Blocked by required conditions
ci / farm rootless fedora-current (push) Blocked by required conditions
ci / unit rootless fedora-current (push) Blocked by required conditions
ci / upgrade v5.3.1 root fedora-current (push) Blocked by required conditions
ci / upgrade v5.6.2 root fedora-current (push) Blocked by required conditions
ci / machine linux amd64 (push) Blocked by required conditions
ci / windows unit (push) Blocked by required conditions
ci / windows e2e (push) Blocked by required conditions
ci / windows machine hyperv (push) Blocked by required conditions
ci / windows machine wsl (push) Blocked by required conditions
ci / macos machine applehv (push) Blocked by required conditions
ci / macos machine libkrun (push) Blocked by required conditions
ci / Total Success (push) Blocked by required conditions
zizmor: GitHub Actions Security Analysis / Zizmor (push) Waiting to run
fix: set correct content-type for generate kube
2026-09-15 11:09:46 +02:00
Madhosh Yagnik
94b0c1df14 pkg/api/handlers/libpod: close quadlet files per iteration and prevent duplicates
processMultipartQuadlets previously deferred closing each multipart part
and file inside the loop, leaking descriptors until the handler returned.
It also opened files with os.Create, silently overwriting earlier files if
a request contained parts with duplicate names.

Align processMultipartQuadlets with the manifests multipart upload handler:
- Wrap each part processing in a closure so part and file descriptors close
  immediately on each loop iteration.
- Use os.OpenFile with os.O_CREATE|os.O_EXCL|os.O_WRONLY (0600) so duplicate
  filenames return an error instead of silently overwriting.
- Sanitize filenames using filepath.Base to prevent directory traversal.
- Add unit tests verifying multiple file extraction, duplicate name rejection,
  and path traversal sanitization.

Fixes: #29752
Signed-off-by: Madhosh Yagnik <madhosh1yagnik@gmail.com>
2026-09-14 23:55:57 +05:30
Matt Heon
6e10d5ac76
Merge pull request #29375 from Mahajan-Sachin/quadlet-volume-remainafterexit
quadlet: do not set RemainAfterExit=yes for volume units by default
2026-09-14 08:52:48 -04:00
Paul Holzinger
687c5e644a
Merge pull request #29525 from sahilnyk/exec-sigproxy-pgid
Some checks are pending
ci / int local rootless fedora-prior (push) Blocked by required conditions
ci / sys local rootless fedora-prior (push) Blocked by required conditions
ci / int remote root fedora-prior (push) Blocked by required conditions
ci / sys remote root fedora-prior (push) Blocked by required conditions
ci / int local root fedora-rawhide (push) Blocked by required conditions
ci / sys local root fedora-rawhide (push) Blocked by required conditions
ci / int local rootless fedora-rawhide (push) Blocked by required conditions
ci / sys local rootless fedora-rawhide (push) Blocked by required conditions
ci / int remote root fedora-rawhide (push) Blocked by required conditions
ci / sys remote root fedora-rawhide (push) Blocked by required conditions
ci / apiv2 root fedora-current (push) Blocked by required conditions
ci / bindings root fedora-current (push) Blocked by required conditions
ci / compose_v2 root fedora-current (push) Blocked by required conditions
ci / docker_py root fedora-current (push) Blocked by required conditions
ci / unit root fedora-current (push) Blocked by required conditions
ci / apiv2 rootless fedora-current (push) Blocked by required conditions
ci / compose_v2 rootless fedora-current (push) Blocked by required conditions
ci / farm rootless fedora-current (push) Blocked by required conditions
ci / unit rootless fedora-current (push) Blocked by required conditions
ci / upgrade v5.3.1 root fedora-current (push) Blocked by required conditions
ci / upgrade v5.6.2 root fedora-current (push) Blocked by required conditions
ci / machine linux amd64 (push) Blocked by required conditions
ci / windows unit (push) Blocked by required conditions
ci / windows e2e (push) Blocked by required conditions
ci / windows machine hyperv (push) Blocked by required conditions
ci / windows machine wsl (push) Blocked by required conditions
ci / macos machine applehv (push) Blocked by required conditions
ci / macos machine libkrun (push) Blocked by required conditions
ci / Total Success (push) Blocked by required conditions
zizmor: GitHub Actions Security Analysis / Zizmor (push) Waiting to run
exec: forward signals to the exec session's process group
2026-09-14 13:32:46 +02:00
Sahil Nayak
903a1b6cb6 exec: forward signals to exec sessions over local and remote
Fixes: #19486
Signed-off-by: Sahil Nayak <contactsahilpnayak@gmail.com>
2026-09-11 21:32:26 +05:30
Matt Heon
b638cc9f48
Merge pull request #29295 from InvalidInterrupt/fix_api_restart_def_timeout
Respect container StopTimeout in container restart REST APIs
2026-09-11 06:40:44 -04:00
Paul Holzinger
0b62a84304
Merge pull request #29653 from Atishyy27/fix/remote-prune-filter-equals-v2
Some checks are pending
ci / int local rootless fedora-prior (push) Blocked by required conditions
ci / sys local rootless fedora-prior (push) Blocked by required conditions
ci / int remote root fedora-prior (push) Blocked by required conditions
ci / sys remote root fedora-prior (push) Blocked by required conditions
ci / int local root fedora-rawhide (push) Blocked by required conditions
ci / sys local root fedora-rawhide (push) Blocked by required conditions
ci / int local rootless fedora-rawhide (push) Blocked by required conditions
ci / sys local rootless fedora-rawhide (push) Blocked by required conditions
ci / int remote root fedora-rawhide (push) Blocked by required conditions
ci / sys remote root fedora-rawhide (push) Blocked by required conditions
ci / apiv2 root fedora-current (push) Blocked by required conditions
ci / bindings root fedora-current (push) Blocked by required conditions
ci / compose_v2 root fedora-current (push) Blocked by required conditions
ci / docker_py root fedora-current (push) Blocked by required conditions
ci / unit root fedora-current (push) Blocked by required conditions
ci / apiv2 rootless fedora-current (push) Blocked by required conditions
ci / compose_v2 rootless fedora-current (push) Blocked by required conditions
ci / farm rootless fedora-current (push) Blocked by required conditions
ci / unit rootless fedora-current (push) Blocked by required conditions
ci / upgrade v5.3.1 root fedora-current (push) Blocked by required conditions
ci / upgrade v5.6.2 root fedora-current (push) Blocked by required conditions
ci / machine linux amd64 (push) Blocked by required conditions
ci / windows unit (push) Blocked by required conditions
ci / windows e2e (push) Blocked by required conditions
ci / windows machine hyperv (push) Blocked by required conditions
ci / windows machine wsl (push) Blocked by required conditions
ci / macos machine applehv (push) Blocked by required conditions
ci / macos machine libkrun (push) Blocked by required conditions
ci / Total Success (push) Blocked by required conditions
zizmor: GitHub Actions Security Analysis / Zizmor (push) Waiting to run
fix(remote): keep '=' in a prune filter value
2026-09-10 18:20:31 +02:00
Paul Holzinger
5004e99e3b
pkg/machine/hyperv: fix incorrect timeout
The timeout is simply to low, I don't know the previous numbers were
collected because they are simply wrong. A machine init takes around 50s
total. And while the ready timeout itself could be shorter there is
really no good reason to set such a low limit as it will cause wrong
failures.

This is currently flaking a lot in CI, I see it in most hyperV logs I
looked at[1]. While there is likely another problem with the boot
failures I think this added a ton of false positives as it errors out
early.

[1] https://github.com/podman-container-tools/podman/actions/runs/34146238887/job/101820830173

Fixes: dd28c14f8c ("hyperv: add timeout to vsock ready wait")

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:42:15 +02:00
Paul Holzinger
2e589e7465
pkg/machine/e2e: lower command timeout
Even on the slowest of CI systems a normal VM start does not seem to
take more than 1 minute.

Instead we seem to have flakes which cause our command to hang on
startup. In that case we thought waiting longer might help but instead
it just wastes 10 minutes.

Se the default command timeout to 3 minutes which should be plenty even
on the slowest of CI systems. Anything above will likely never finish
and we can just abort the test as failed.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:31:04 +02:00
Paul Holzinger
d42ad4aae3
pkg/machine/e2e: combine one --import-native-ca test
Combine the no volume and --import-native-ca test into one.

This removes one full machine init/start/stop cycle.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:24:17 +02:00
Paul Holzinger
ee7d3c534c
pkg/machine/e2e: combine build context test
Instead of creating a fresh machine which is slow reuse an existing
test for this test.

Also fix the test to actually check the file content properly, it was
using the wrong build output. And then just use one cat for both files
to make it a tiny bit faster.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:24:17 +02:00
Paul Holzinger
66a1bee8d5
pkg/machine/e2e: inline one remove test
Avoid another init/start cycle by reusing an existing test which has a
VM running already.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:24:17 +02:00
Paul Holzinger
f1f52763cb
pkg/machine/e2e: combine api test cases
Only start a machine once, not three times to safe time.

Also include stdout/err as part of the curl command so errors are
visible. And lastly the latest moby client code should support unix
sockets on windows so we can test it there as well.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:45 +02:00
Paul Holzinger
49aec99596
pkg/machine/e2e: inline stop running machine
Instead of having to start a new machine again here just drop the test
and do the stop check as part of another test which already has a
machine running.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:45 +02:00
Paul Holzinger
9002dce687
pkg/machine/e2e: use withFakeImage for excessive cpus test
The test should fail before booting a real VM so we can use the fake
image which should make the test a few seconds faster.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:45 +02:00
Paul Holzinger
1b6d77299e
pkg/machine/e2e: remove simple init with start
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:44 +02:00
Paul Holzinger
ccd3778087
pkg/machine/e2e: remove start simple machine
The test starts a machine 3 times taking almost 180 seconds in linux CI.

We have a lot of machine starts elsewhere already so we really do not
need a basic start and for the quiet/noinfo checks we can just add them
to another existing start command.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:44 +02:00
Paul Holzinger
d99f1d5564
pkg/machine/e2e: rename toQemuInspectInfo to toInspectInfo
There is nothing qemu specifc about this for a long time. Just drop it
from the name.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:44 +02:00
Paul Holzinger
3ffe582563
pkg/machine/e2e: combine machine set rootful tests
Each machine start/stop adds up in CI, combine several related tests to
reduce the machine init/start/stops cycles.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:44 +02:00
Paul Holzinger
d3f30f698e
pkg/machine/e2e: correctly handle set --rootful=false
On podman machine set we have three modes, not set (keep user),
--rootful (set user to root), --rootful=false (set to rootless user).

The later could not be passed at all before this.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:44 +02:00
Paul Holzinger
f4df65a859
pkg/machine/e2e: combine two restart machine tests
The restart tests are rather slow. On the linux CI 60 seconds for the
stopped case and almost 120 seconds for the restart running case.

Combine both cases into one so we only have to start a machine twice,
not three times and only need to init it once.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-08 12:16:43 +02:00
Lokesh Mandvekar
10b487f229
Merge pull request #29722 from Luap99/lint
Update golangci/golangci-lint to v2.13.2
2026-09-07 09:33:26 -04:00
Sachin Mahajan
e822e89e5d quadlet: do not set RemainAfterExit=yes for volume units by default
Do not set RemainAfterExit=yes by default when converting Quadlet
.volume files to systemd oneshot services.

Setting RemainAfterExit=yes causes systemd to consider the volume
service active even after the volume is deleted manually, preventing
systemd from re-executing volume creation when dependent container
services restart.

Fixes #27862

Signed-off-by: Sachin Mahajan <sachinmahajan903@gmail.com>
2026-09-07 16:26:10 +05:30
Sejal
b5b558d671 fix: set correct content-type for generate kube
Fixes: #29674
Signed-off-by: Sejal <sej1306kook@gmail.com>
2026-09-05 23:21:50 +00:00
Danish Prakash
764021086d
Merge pull request #29606 from vishnukothakapu/perf-slices-sort
Performance: Upgrade sort.Slice to slices.SortFunc across codebase
2026-09-04 21:19:24 +05:30
Paul Holzinger
eea3fa25da
silence new platform specific staticcheck issues
These errors only happen on windows or freebsd. They happen when a
function always returns a hard error there so it assumes the condition
is always true which is not the case on another platform.

We then also need to use nolintlint so it does not trigger on linux
where the nolint is not needed otherwise.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-04 17:21:15 +02:00
Paul Holzinger
3222b4bc25
fix new golangci-lint staticcheck warnings
Looks like it picked up new deprecated matches so we need some more
nolint to silence them where we still need them for backwards compat in
the API.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-04 16:40:03 +02:00
Paul Holzinger
53a9bcbe13
run golangci-lint --fix
In order to fix the new formatting issues reported.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-04 16:30:10 +02:00
Paul Holzinger
68180a8db2
Merge pull request #29613 from ROKUMATE/test-systemd-parser-escape
pkg/systemd/parser: add tests for escapeWords and escapeString
2026-09-04 16:14:28 +02:00
Paul Holzinger
afe45cccb6
Merge pull request #29714 from Luap99/go-1.26
Update to Go 1.26
2026-09-04 15:48:09 +02:00
Paul Holzinger
8b216d16c4
Merge pull request #29656 from hkwi/fix-compat-stats-http-status
api: reflect container stats errors in HTTP status codes
2026-09-04 15:17:42 +02:00
Paul Holzinger
258001db67
Merge pull request #29496 from simek-m/RUN-3319-info-runtimes-status
compat: Add status for runtimes to GET /info
2026-09-04 13:54:34 +02:00
Hiroaki KAWAI
d56f52c8a7
api: reflect container stats errors in HTTP status codes
Existing KillContainer handling uses HTTP status code 409 when the request cannot be performed because of the current container state. HTTP status code 404 is also used when the target container does not exist.

In contrast, errors from the stats handler are not reflected in the HTTP status code. The HTTP status code is always 200, and the errors are recorded only as generic errors in the server log.

To maintain compatibility with both streaming enabled and disabled, this change treats obtaining at least one complete unit of response content as the response contract. It then keeps the response content consistent with the HTTP status code.

Signed-off-by: Hiroaki KAWAI <hiroaki.kawai@gmail.com>
2026-09-04 20:42:55 +09:00
Paul Holzinger
6c6eac3a5c
run modernize -fix ./...
Since I use go 1.26 the go fix does not have all the rules built in,
there are newer ones in modernize so run the explicitly to fix more code
for go 1.26.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-04 11:53:04 +02:00
Paul Holzinger
526fbee8cc
pkg/systemd/notifyproxy: fix govet lint error
This is getting flagged with go.126 now. We need to use %d to log an
integer.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-04 11:53:04 +02:00
Paul Holzinger
03ee16f5b4
pkg/domain/filters: fix exit code parsing error
The function logged the wrong error, logging ec which is the return
value from ParseInt makes no sense since the error tells us the function
failed so ec is invalid/undefined. Also ParseInt already includes the
string input in the error so just drop it.

This was flagged by govet now that we use go 1.26 because %q was wrong
for integers.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-04 11:53:04 +02:00
Paul Holzinger
eb96a9d5b8
run go fix ./...
Plus manually deleting the left over inline functions because go fix
doesn't do that even though they are private functions.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-09-04 11:53:04 +02:00
Jan Rodák
ec30171911
Merge pull request #29660 from simek-m/RUN-3316-compat-until-filter
compat: Document and test GET /images/json until filter
2026-09-04 11:45:24 +02:00
Marek Simek
81ec75c4ec
compat: Add status for runtimes to GET /info
Docker API v1.44 now includes status properties
in Runtimes for the GET /info endpoint.

Read output of {oci_runtime_cmd} features command
lazily and expose the JSON
output as-is (with removed new lines and
whitespace) as the status field in GET
/info for v1.44+.

Add status to libpod GET /info in ociRuntime.features
and `podman info` (shared).

Add API tests for both endpoints.

Fixes: https://redhat.atlassian.net/browse/RUN-3319
Signed-off-by: Marek Simek <msimek@redhat.com>
2026-09-04 11:37:47 +02:00
Paul Holzinger
92a3a02313
Merge pull request #29712 from WhyNotHugo/test-arches
Restrict tests to the same architectures as non-test code
2026-09-03 19:32:50 +02:00
Paul Holzinger
f6487b7546
Merge pull request #29669 from CodeWithAK28/manifest-annotate-subject-remote
pkg/bindings, pkg/api: send the manifest index subject to the server
2026-09-03 18:21:01 +02:00
Hugo Osvaldo Barrera
1f1c233202 Restrict tests to the same architectures as non-test code
ostree.go is limited to only amd64 and arm64, but its tests run on all
architectures and fail because all their symbols are missing.

Don't run tests on an architecture where the non-test code doesn't
exist.

References: https://github.com/podman-container-tools/podman/issues/29711
Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
2026-09-03 14:19:47 +02:00
Garry Lawrence
545674291a Respect container StopTimeout in container restart REST APIs
RestartContainer was always setting options.Timeout with values
from query, without checking if the caller had specified them or if
they were simply zero values. Copy logic from StopContainer to check
for caller-specified values, leaving Timeout nil if not specified.

fixes: https://github.com/podman-container-tools/podman/issues/29276
Signed-off-by: Garry Lawrence <InvalidInterrupt@users.noreply.github.com>
2026-09-02 10:39:55 -07:00
Anisha Khairnar
96da3c9fc6 pkg/bindings: fix podman --remote manifest add --artifact hanging forever
The remote client uploads the artifact files from a goroutine and waits for it with a sync.WaitGroup, but the goroutine never calls Done(), so Wait() blocks for good and the command never returns. Nothing caught it because no test ran manifest add --artifact against podman-remote.

Start the goroutine with WaitGroup.Go, which releases the counter on its own once the upload is finished.

Signed-off-by: Anisha Khairnar <anishakhairnar284@gmail.com>
2026-09-02 14:02:28 +05:30
Anisha Khairnar
b760306614 pkg/bindings, pkg/api: send the manifest index subject to the server
Two commands can set a subject on a manifest list, podman manifest annotate --index --subject and podman manifest add --artifact-subject. Both work locally, but they do nothing at all when podman runs with --remote.

The value never leaves the client. Before sending the request the remote client copies everything into manifests.ModifyOptions and manifests.AddArtifactOptions, and neither struct had a field to hold the subject, so it was quietly thrown away. The server had a second problem of its own, ManifestModify rebuilds ManifestAddArtifactOptions by hand and left out the embedded ManifestAnnotateOptions, so --os, --arch and --annotation were being dropped there as well.

Add the missing field to both structs, fill it in from the tunnel ImageEngine, and let the handler pass the annotate options along. Also add two system tests that run both flags for real so the remote path stays covered.

Signed-off-by: Anisha Khairnar <anishakhairnar284@gmail.com>
2026-09-02 11:57:43 +05:30
Ashley Cui
af579ec299 Add --platform to podman push
When pushing a manifest list, --platform=OS[/Arch[/Variant]] selects and pushes a single platform-specific manifest instead of the entire list.
Also, update compat POST /images/{name}/push to support the platform param (Compat v1.46)

Signed-off-by: Ashley Cui <acui@redhat.com>
2026-09-01 11:30:48 -04:00
Ashley Cui
48dfbd2dd3 Vendor container-libs@main
Signed-off-by: Ashley Cui <acui@redhat.com>
2026-09-01 11:30:39 -04:00
Paul Holzinger
2866ef50a1
Merge pull request #29684 from giuseppe/fix-overlay-volume-userns
libpod: fix :O overlay volumes in a userns
2026-09-01 11:39:26 +02:00
Giuseppe Scrivano
c56c2fc5f8
libpod: do not block idmap with overlay (O) volumes
Allow the `idmap` volume option to be combined with the overlay `O`
option, e.g. `-v /src:/mnt:O,idmap` or `-v myvol:/mnt:O,idmap`.
Previously any option other than `U`, `upperdir` and `workdir` combined
with `O` was rejected.

The parser in GenVolumeMounts now accepts `idmap` alongside `O` and
rejects the first disallowed option instead of counting flags.  The
mappings from the container's user namespace are threaded onto the
generated overlay mount so the runtime idmaps it.  This is done for both
the anonymous/host-path overlay volumes and the named-volume overlay
path, which are handled by separate code.

When a volume is idmapped the runtime shifts the mount so that on-disk
IDs map identically into the container, so the overlay backing dirs
(contentDir, upperdir, workdir) must be owned by real root (0) rather
than the host IDs the container root maps to; otherwise they surface as
the overflow ID inside the container and are inaccessible.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2026-09-01 09:50:51 +02:00