Commit Graph

7392 Commits

Author SHA1 Message Date
Jannik Glückert
b0cb2bb011 fix ssh config parsing for HostName
A later invocation to url.Parse() needs a preceding scheme,
otherwise the hostname just gets discarded.

Fixes #25067

Signed-off-by: Jannik Glückert <jannik.glueckert@gmail.com>
Signed-off-by: KILA <32559459+kila-star1127@users.noreply.github.com>
2026-06-05 18:10:07 +00:00
Paul Holzinger
486bacd3e4 Merge pull request #28335 from axel7083/refactor/quadlet-applications
refactor: podman quadlet sub-command
2026-06-05 17:55:51 +02:00
Paul Holzinger
2d369caca7 Merge pull request #28823 from inknos/run-4472
machine: share virtiofs systemd unit generation
2026-06-03 19:13:51 +02:00
Paul Holzinger
fab963e01c Merge pull request #28693 from kolyshkin/change-label
bump selinux to v1.15.1, use SetProcessKind
2026-06-03 18:42:58 +02:00
Brent Baude
e32fc614df Merge pull request #28800 from danishprakash/remote-log-path
specgen: move log_path handling over to the server
2026-06-03 08:59:54 -05:00
Giuseppe Scrivano
1a76d464fd cmd, commit: change --pause default to true
Pause the container by default during commit.  It is safer as it
avoids conflicts, and potentially security issues, when another
process is accessing the container rootfs.

Originally this was not done because it was a breaking change and
rootless containers weren't able to use the freezer cgroup controller.
Now that we support only cgroup v2, there is no gap anymore with
root (exotic configurations can still use --pause=false).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2026-06-03 07:28:22 +02:00
Danish Prakash
bad0a715ee specgen: move log_path handling over to the server
log_path is currently set at the client side and is ignored by
the server in a remote session. This leads to either incorrect log_path
being considered by the server or not honored at all. Move the handling
from client to the server, in line with other flags such as log_driver.

Signed-off-by: Danish Prakash <contact@danishpraka.sh>
2026-06-03 09:22:50 +05:30
Kir Kolyshkin
ad7b6be2b9 bump selinux to v1.15.1, use SetProcessKind
I was not able to find any external users of pkg/selinux but kept it
for now (and marked as deprecated) so we can remove it later.

PS pkg/selinux adds go:fix directives which are not (yet) recognized
by the gocheckcompilerdirectives linter, so add a temporary exception).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-06-02 11:18:34 -07:00
Nicola Sella
d6cf6e8495 machine: share virtiofs systemd unit generation
Make GenerateSystemDFilesForVirtiofsMounts an agnostic function
and move the code from apple to pkg/machine/volume_systemd.go

MountVolumesToVM  is now a no-op matching the AppleHV and
LibKrun behaviour.

Continues from PR: https://github.com/podman-container-tools/podman/pull/28736

Fixes: https://redhat.atlassian.net/browse/RUN-4742

Signed-off-by: Nicola Sella <nsella@redhat.com>
2026-06-02 14:47:08 +02:00
axel7083
496646f0da feat: update podman quadlet sub-command
Fixes: #28118
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2026-06-02 09:52:49 +00:00
Tom Sweeney
8b1e46170b Adjust API calls for compression
Add the various compression API calls as created by @nalind in #28807

Signed-off-by: Tom Sweeney <tsweeney@redhat.com>
2026-05-29 09:10:50 -04:00
Paul Holzinger
13c6b5d786 pkg/bindings/generator: fall back to golangci-lint from $PATH
Commit cf021c4ba9 switched the logic to also allow golangci-lint in
$PATH but forgot to update the call here.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-05-28 20:38:49 +02:00
Nicola Sella
e59b9dae8f api/libpod: fix r_limits cleared on update
Returnin nil when input is empty, to skip rlimit replacement
when r_limits is not present in the request.

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

Signed-off-by: Nicola Sella <nsella@redhat.com>
2026-05-27 13:32:31 +02:00
Brent Baude
e581ddc253 Merge pull request #28731 from lstocchi/hyperv_enhancements
Fixes for Hyper-V user experience
2026-05-26 10:30:18 -05:00
Paul Holzinger
22c5f3fa55 Merge pull request #28527 from vyasgun/pr/krunkit-timesync
machine: add vfkit timesync device for Apple VMs
2026-05-26 12:23:04 +02: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
lstocchi
f96cbda1b0 hyperv: propagate detailed error from Hyper-V permission checks
Change isHyperVAdminMember from returning a bool to returning an error so that callers surface the specific failure reason — particularly distinguishing "not in the group" from "in the group but session not updated" (new ErrHypervUserSessionNotUpdated sentinel). This gives users actionable guidance instead of a generic permission error.

Signed-off-by: lstocchi <lstocchi@redhat.com>
2026-05-25 00:10:18 +02:00
Kir Kolyshkin
d4f60b5826 libpod: some modernize fixes for freebsd and darwin
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-05-22 14:15:49 -07:00
Kir Kolyshkin
bf78f80b00 Replace strings.Split(..)[0] with strings.Cut
These places were ignored by modernize, so I did some grepping and
editing.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-05-22 13:08:56 -07:00
Kir Kolyshkin
b4d0747baa pkg/systemd/parser: use slices.Backward
Suggested by modernize (aka go fix).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-05-22 12:28:16 -07:00
Kir Kolyshkin
7797dcb2ab pkg/domain/infra/abi: modernize
Use slices.Contains instead of for loop. Suggested by modernize
(aka go fix).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-05-22 12:26:59 -07:00
Kir Kolyshkin
121948d69e pkg/rootless: modernize
Using modernize (aka go fix) from Go 1.26.3, implement the following
changes:

> pkg/rootless/rootless_linux.go:319:30: fmtappendf: Replace []byte(fmt.Sprintf...) with fmt.Appendf (modernize)
> 		err = os.WriteFile(uidMap, []byte(fmt.Sprintf("%d %d 1\n", 0, os.Geteuid())), 0o666)
> 		                           ^
> pkg/rootless/rootless_linux.go:339:30: fmtappendf: Replace []byte(fmt.Sprintf...) with fmt.Appendf (modernize)
> 		err = os.WriteFile(gidMap, []byte(fmt.Sprintf("%d %d 1\n", 0, os.Getegid())), 0o666)
> 		                           ^
> pkg/rootless/rootless_linux.go:381:6: rangeint: for loop can be modernized using range over int (modernize)
> 	for sig := 0; sig < numSig; sig++ {
> 	    ^
> pkg/rootless/rootless_linux.go:432:24: stringsseq: Ranging over SplitSeq is more efficient (modernize)
> 	for _, entry := range bytes.Split(data, []byte{0}) {
> 	                      ^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-05-22 12:25:21 -07:00
Daniel J Walsh
f524bce46a Merge pull request #28753 from kolyshkin/os-is
Stop using os.Is{Exist,NotExist,Permission} checks
2026-05-22 05:18:45 -04:00
Tom Sweeney
3fb897f154 Merge pull request #28747 from kolyshkin/lint-nits
Remove unused nolint annotations
2026-05-21 19:58:34 -04: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
Paul Holzinger
23cc1a30fb Merge pull request #28735 from mvanhorn/fix/28298-podman-io-community-trailing-slash
docs(api): drop trailing slash on podman.io/community contact URL
2026-05-21 07:56:03 +02:00
Kir Kolyshkin
a7886d1fe8 Remove unused nolint annotations
The interfacer linter was removed a few years ago.

Remove the annotations as well.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-05-20 15:02:25 -07: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
Gunjan Vyas
250e5f9914 use constant for timesync port and update mac_env.sh to print krunkit version
Signed-off-by: Gunjan Vyas <vyasgun20@gmail.com>
2026-05-20 12:56:50 +05:30
Brent Baude
6ef4d68da4 Merge pull request #28723 from SebTardif/fix/close-directory-handle-registries-d
pkg/trust: fix directory handle leak in loadAndMergeConfig
2026-05-19 15:58:39 -05:00
Brent Baude
3c4fb923f0 Merge pull request #28724 from SebTardif/fix/close-leaked-file-handles
Close leaked file handles in container config, CRIU stats, and playbook read
2026-05-19 15:56:27 -05:00
Matt Van Horn
f2a51888f3 docs(api): drop trailing slash on podman.io/community contact URL
The swagger spec generated from pkg/api/server/doc.go sets the contact
URL to https://podman.io/community/. That URL now returns 404, while
https://podman.io/community (no trailing slash) returns 200 and is what
the live site links to from its own navigation. Issue #28298 reports
the link as broken at the top of the rendered API reference, which is
where ReDoc surfaces the contact field.

Drop the trailing slash so the contact link in the generated swagger
spec resolves.

Signed-off-by: Matt Van Horn <mvanhorn@gmail.com>
2026-05-19 02:48:35 -07:00
Gunjan Vyas
e5bef8b124 machine: add vfkit timesync device for Apple VMs
Fixes: #28345

Signed-off-by: Gunjan Vyas <vyasgun20@gmail.com>
2026-05-19 13:23:01 +05:30
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
Sebastien Tardif
846d1a1b05 Close leaked file handles in container config, CRIU stats, and playbook read
Add missing defer Close() calls in four locations:

- libpod/container.go: specFromState() opens the container config file
  but never closes it after reading, leaking one fd per call.

- libpod/container_internal_common.go: checkpoint() and restore() each
  open the bundle directory for CRIU statistics but never close it,
  leaking one fd per checkpoint/restore operation.

- pkg/machine/shim/host.go: Init() opens the playbook file but never
  closes it after ReadAll, leaking one fd per machine init.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
2026-05-17 16:09:56 -07:00
Sebastien Tardif
39e5a0a0b9 Add unit tests for loadAndMergeConfig
Cover non-existent directory, empty directory, and existing testdata
directory paths to verify config merging and directory handle cleanup.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
2026-05-17 16:07:48 -07:00
Sebastien Tardif
72af655040 pkg/trust: fix directory handle leak in loadAndMergeConfig
The os.Open(dirPath) call opens a directory handle used for
Readdirnames() but never closes it, leaking one file descriptor
per call to loadAndMergeConfig().

Add defer dir.Close() after the error check.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
2026-05-17 13:51:04 -07:00
Byounguk Lee
e36e2c97d2 bindings/artifacts: remove redundant nameOrID parameter from Remove for 6.0
Signed-off-by: Byounguk Lee <nimdrak@gmail.com>
2026-05-17 08:11:53 +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
Maya Chen
2f17614d0e fix: duplicated words in decompress.go log message and annotations.go comment
Signed-off-by: Maya Chen <275405107+otjdiepluong@users.noreply.github.com>
2026-05-14 05:08:45 +00: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
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
Kir Kolyshkin
40e572f2ed Update oc/selinux to v1.14.1
There are some deprecations so done manually.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-05-11 11:04:23 -07:00
Paul Holzinger
a6e58ea101 wsl: remove custom registries.conf
This is already part of the base machine image, also with the overmount
of /etc/containers this would no loner be read anyway.

The machine-os update for this is here:
https://github.com/containers/podman-machine-os/pull/239

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-05-11 15:58:03 +02:00
Paul Holzinger
93b615c1f2 machine: move marker file to /etc/podman-machine
Matches changes from https://github.com/containers/container-libs/pull/779

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-05-11 15:58:03 +02:00
Paul Holzinger
e34f3bce0c machine: remove SSL_CERT_DIR/SSL_CERT_FILE copy
With podman 6 we have a --import-native-ca option that handles the
copying of certs much better.

As such remove our old legacy way of copying files these envs and also
the static certs.d dir. Since we now mount the full containers config
dir the certs from the cert.d are mounted already.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-05-11 15:58:03 +02:00
Paul Holzinger
b14e833ef6 machine: add test to check config mount
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-05-11 15:58:03 +02:00
Paul Holzinger
5e193ce96a wsl: mount config home dir like on other providers
The other providers use the volume mounts from containers.conf which
should take care of it. But because WSL is not using this we need to
hard code this ourselves.

Add a new custom unit to make systemd mount the path like we do for
podman socket mounts.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-05-11 15:58:03 +02:00