Commit Graph

4500 Commits

Author SHA1 Message Date
Amol Yadav
ac7d6c3fc4 inspect: preserve secret target name in env masking
Fixes #28075

Signed-off-by: Amol Yadav <amyssnipet@yahoo.com>
2026-02-13 22:43:14 +05:30
Kir Kolyshkin
24a04de921 libpod: fix build
In the currently used go.podman.io/common/pkg/libartifact version
there is no store subpackage (yet). Fix the import statement and
usage accordingly.

Fixes: df0e3b6ec7 ("libpod: move artifact volume validation to creation phase"
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-12 17:30:07 -08:00
Paul Holzinger
89b646d8a3 Merge pull request #27946 from kairosci/fix/27747-artifact-volume-validation
libpod: move artifact volume validation to creation phase
2026-02-12 20:22:32 +01:00
Paul Holzinger
88bd85367d Merge pull request #28008 from shiv-tyagi/vendor-detection
Discover GPU vendor from CDI spec before injecting GPU for --gpus option
2026-02-12 18:54:34 +01:00
Alessio Attilio
df0e3b6ec7 libpod: validate artifact volume on create
Fixes: #27747
Signed-off-by: Alessio Attilio <attilio.alessio@protonmail.com>
2026-02-12 18:24:16 +01:00
Shiv Tyagi
d7a80dda1e Discover vendor from cdi spec before injecting CDI device for --gpu option
Signed-off-by: Shiv Tyagi <Shiv.Tyagi@amd.com>
2026-02-12 12:11:47 +00:00
Kir Kolyshkin
0ba42fe487 ci: bump golangci-lint to v2.9.0
Apparently, prealloc got much smarter in this version, so let's disable
it for _test.go files as we're not really interested in
micro-optimizations for the test code.

The rest of its warnings is being fixed by the earlier commits.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-11 11:41:11 -08:00
Kir Kolyshkin
3c3d32718f libpod: do not reuse names slice
Do not reuse names slice for the unrelated data. This fixes the
following prealoc warning:

> libpod/storage.go:109:2: Consider preallocating names with capacity 2 (prealloc)
> 	names := []string{containerName}
> 	^

This commit is part of series fixing issues reported by prealloc linter
from golangci-lint v2.8.0.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-11 11:41:11 -08:00
Kir Kolyshkin
b046387979 Inline the initial slice into append
Instead of creating a slice and then appending to it, let's inline the
initial slice into append. This may or may not result in less slice
reallocations, but it is silencing the prealloc linter warnings.

This commit is part of series fixing issues reported by prealloc linter
from golangci-lint v2.8.0.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-11 11:41:10 -08:00
Kir Kolyshkin
030057aecd Preallocate a slice
When we already know the resulting slice size but still need/want to use
append, it makes sense to preallocate the slice by using make with the
capacity argument.

This commit is part of series fixing issues reported by prealloc linter
from golangci-lint v2.8.0.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-11 11:41:10 -08:00
Kir Kolyshkin
d316cbb362 Don't use append if not necessary
Calling append can lead to resizing the slice. In case we have all
elements beforehand, it is not necessary to call append in the first
place and this avoid resizing.

This is the first part of fixing issues reported by prealloc linter from
golangci-lint v2.8.0.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-11 11:41:10 -08:00
Patrick Wicki
2828965a75 healthcheck_linux: avoid failing transient units
The main purpose of the transient services/timers is to trigger the
healthcheck execution in regular intervals, their own state should
not depend on the result of the healthchecks. This way there are no
failing systemd services unless there is actually a fatal error.

Signed-off-by: Patrick Wicki <patrick.wicki@siemens.com>
2026-02-09 19:52:29 +01:00
Kir Kolyshkin
49cce3ec16 libpod: modernize state test
Use t.Helper, t.TempDir, and t.Cleanup in getEmptySqliteState,
simplifying its code and its users.

Simplify runForAllStates: remove redundant t.Fail call, and move
getEmptySqliteState call under t.Run.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-07 12:11:47 -08:00
Paul Holzinger
ff7406b733 Merge pull request #27927 from kairosci/fix/27823-host-gateway-localhost
fix: use localhost for host.containers.internal in host network mode
2026-02-03 20:08:43 +01:00
SanjayReddy91
82e04e8d7f fix: prevent race condition during database initialization by using INSERT OR IGNORE.
Signed-off-by: SanjayReddy91 <gamerzdamnyt1234@gmail.com>

test: add test to check if SQLite DB config change will mitigate race condition when multiple podman process start at once.

Signed-off-by: SanjayReddy91 <gamerzdamnyt1234@gmail.com>

test: Check to ensure only one row was created in DBConfig table.

Signed-off-by: SanjayReddy91 <gamerzdamnyt1234@gmail.com>

test: Changed no of processes started at once to 20.

Signed-off-by: SanjayReddy91 <gamerzdamnyt1234@gmail.com>

test: rc reset to 0 to not affect second part of the test, db path is no longer hardcoded in test case.

Signed-off-by: SanjayReddy91 <gamerzdamnyt1234@gmail.com>

test: Reverted test case.

Signed-off-by: SanjayReddy91 <gamerzdamnyt1234@gmail.com>

lint: removed trailing whitespaces.

Signed-off-by: SanjayReddy91 <gamerzdamnyt1234@gmail.com>
2026-02-03 22:47:09 +05:30
Alessio Attilio
fae93fe483 fix: use localhost for host.containers.internal in host network mode
Signed-off-by: Alessio Attilio <attilio.alessio@protonmail.com>
2026-02-03 18:00:51 +01:00
Paul Holzinger
19aba793c0 remove dep on github.com/containers/conmon
We use only for a single const so inline that and use a better variable
name.

The main reason is the latest version of conmon removed that go code so
the update of it will be broken.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-01-30 12:51:50 +01:00
Brent Baude
3d4f25e6d3 Merge pull request #27936 from inknos/get-exists-quadlet-api
Add GET /quadlets/{name}/exists
2026-01-28 10:58:46 -06:00
Brent Baude
b60d234da4 Merge pull request #27827 from lsm5/podman6-no-cni
Podman6: Remove CNI
2026-01-28 10:20:56 -06:00
Nicola Sella
eb0c4716d3 Add GET /quadlets/{name}/exists
Fixes: https://issues.redhat.com/browse/RUN-4068

Signed-off-by: Nicola Sella <nsella@redhat.com>
2026-01-27 16:10:56 +01:00
Lokesh Mandvekar
454167efa9 Remove CNI-specific code paths from libpod
Remove CNI-specific conditional logic and update comments throughout
the libpod networking code:

- Simplified DNS configuration logic in container_internal_common.go
  to always use netavark behavior (removed backend checks)
- Removed CNI-specific iptables chain error regex pattern
- Updated all comments referencing 'CNI' to use 'netavark' or
  'network backend'
- Renamed variable 'cniNet' to 'netInfo' for clarity
- Updated field and type documentation to remove CNI references

All networking code now assumes netavark as the sole backend.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-27 16:32:38 +05:30
Lokesh Mandvekar
f6bddc8af2 Remove CNI backend configuration from runtime
Remove runtime configuration options for CNI network backend:

Runtime options:
- Remove WithNetworkBackend() runtime option function
- Function allowed setting network backend programmatically

Flag handling:
- Remove --network-backend flag change detection
- Remove call to WithNetworkBackend() when flag changed
- Remove TODO comment about CNI plugins directory flag

The network backend configuration is now handled entirely by the
vendored common/libnetwork code, which will default to Netavark.
There is no longer any way to configure CNI as the network backend
through Podman's runtime initialization.

Note: libpod/info.go keeps existing NetworkBackend reporting logic
which will automatically report "netavark" as the only backend since
configuration defaults to netavark and cannot be changed to CNI.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-27 16:32:38 +05:30
Brent Baude
2d67bf3b0a Vendor common test for artifact digest lookup
Vendor latest common with artifact changes

Signed-off-by: Brent Baude <bbaude@redhat.com>
2026-01-26 15:45:56 -06:00
Giuseppe Scrivano
f172ff789b rootless: use nsfs file handles to persist namespaces
use name_to_handle_at and open_by_handle_at to persist rootless
namespaces without needing a pause process.

The namespace file handles are stored in a file and can be used to
rejoin the namespaces, as long as the namespaces still exist.

Fall back to the pause process approach only when the kernel doesn't
support nsfs handles (EOPNOTSUPP).

The feature is currently only enabled when the PODMAN_NO_PAUSE_PROCESS
environment variable is set.

These changes in the kernel are required (landed in Linux 6.18):

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3ab378cfa793

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2026-01-20 18:41:59 +01:00
Alessio Attilio
6c1d8f5d76 libpod: fix Volume.Mount() returning empty path for plugin volumes
Fixes: #27858
Signed-off-by: Alessio Attilio <attilio.alessio@protonmail.com>
2026-01-19 14:54:27 +01:00
Matt Heon
cb67dafd36 Merge pull request #26445 from aaron-ang/update-ulimit
Add ulimits to `podman update`
2026-01-16 08:38:00 -05:00
Brent Baude
75ab2006a2 Merge pull request #27891 from caxu-rh/libpod-simplify
libpod: simplify unnecessary loops
2026-01-15 10:35:37 -06:00
Brent Baude
94cf4e314b Merge pull request #27730 from inknos/delete-quadlet-api
Add DELETE /libpod/quadlets
2026-01-15 09:43:37 -06:00
Nicola Sella
2e23fcc5a5 Add DELETE /libpod/quadlets
Fixes: https://issues.redhat.com/browse/RUN-3742

Signed-off-by: Nicola Sella <nsella@redhat.com>
2026-01-15 12:10:32 +01:00
shiavm006
231dbdf5b3 Fix container export emitting incorrect event type.
Signed-off-by: shiavm006 <shivammittal42006@gmail.com>
2026-01-12 16:25:25 +05:30
Caleb Xu
f6e3200f40 libpod: simplify unnecessary loops
Signed-off-by: Caleb Xu <caxu@redhat.com>
2026-01-09 16:49:33 -05:00
Jason Oh
86799cb2cb Fixes #27651 - Fix health inspect/ps for rootfs containers with empty healthcheck
Signed-off-by: Jason Oh <jasonoh@utexas.edu>
2026-01-07 12:18:01 -06:00
Ashley Cui
aa1d7b189a Remove network-cmd-path
As part of slirp removal.
RUN-3569

Signed-off-by: Ashley Cui <acui@redhat.com>
2025-12-19 16:52:49 -05:00
Paul Holzinger
8d0ecd4d84 Merge pull request #27330 from winterqt/push-pwouqluolwxt
libpod: fix healthchecks not executing every interval on linux
2025-12-12 18:15:05 +01:00
Paul Holzinger
2608feb4f7 Merge pull request #27708 from anagno/fix/probe
fix: skip execution of probes when initialDelaySeconds is not elapsed
2025-12-11 15:35:06 +01:00
Vasileios Anagnostopoulos
88bacfc133 fix: skip execution of probes when initialDelaySeconds is not elapsed
According to the [Kubernetes docs](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes)
the probes should be executed after the `initialDelaySeconds`. So to be
consistent with the kubernetes specs, skip the execution of the probes until
the `initialDelaySeconds` is elapsed.

Closes #27678

Signed-off-by: Vasileios Anagnostopoulos <anagnwstopoulos@hotmail.com>
2025-12-11 12:50:24 +01:00
Brent Baude
f348a0717d Vendor latest mono repo for libartifact changes
This PR vendors in the strong typed libartifact code and carries the
associated changes.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-12-10 14:44:50 -06:00
Matt Heon
a8ecb80ac0 Deterministically order pod inspect fields
There are two fields I'm worried about: shared namespaces and pod
containers. Both are generated via loops over maps and are thus
non-deterministic in ordering. Throw a sort on each to fix the
order so we can actually diff `podman pod inspect` output.

Signed-off-by: Matt Heon <mheon@redhat.com>
2025-12-04 15:25:11 -05:00
openshift-merge-bot[bot]
244aa643c7 Merge pull request #27672 from Luap99/workdir
libpod: fix workdir MkdirAll() all check
2025-12-04 15:52:35 +00:00
openshift-merge-bot[bot]
5508d873c1 Merge pull request #27619 from Honny1/fix-unless-stopped-reboot
Fix `unless-stopped` restart policy to match Docker behavior
2025-12-04 15:04:10 +00:00
Paul Holzinger
d18e44e9ab libpod: simplify resolveWorkDir()
The code checks for isPathOnVolume and isPathOnMount so we can just use
the SecureJoin here directly to check for path existance.

Then instead of walking symlinks and trying to guess if they are on a
mount just assume if it is a link (path is different from the normal
joined one) then don't error out early and let the OCI runtime deal with
it. The runtime does produce a less readable error but it still fails
and we have much less fragile code.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-12-04 15:25:49 +01:00
Paul Holzinger
7b1be7f177 libpod: fix workdir MkdirAll() all check
MkdirAll can fail with EEXIST when the path is a symlink and the target
doesn't exist. As such we should ignore the error.

Note there is something fundemantal wrong here with the path access as
it is following the symlink to the host, however it is only for a
stat() so it is not an security issue here.

Fixes: 637c264e2e ("fix issues found by nilness")

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-12-04 15:25:30 +01:00
Lokesh Mandvekar
b78f1cf986 vendor: update container-libs to df55d6c661e8 for cgv1 removal
Also simplifies cgroups.AvailableControllers

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-12-02 15:38:30 -05:00
Jan Rodák
4d3c6311a5 Fix unless-stopped restart policy to match Docker behavior
- Update documentation: Differentiate `unless-stopped` from `always` - containers stopped by the user before a reboot will not restart.
- Add `should-start-on-boot` filter: Identify containers that require a restart after a system reboot.
- Update command documentation: Add `restart-policy` and `label!` filters to the documentation for container commands (rm, ps, start, stop, pause, unpause, restart).
- Add `restart-policy` and `shoud-start-on-boot` to completions.
- Update service: Update `podman-restart.service` to use the `needs-restart=true` filter.
- Preserve state: Preserve the `StoppedByUser` state across reboots.
- Update API: Add a `ShouldStartOnBoot()` method to the Container API.
- Update documentation: Add descriptions for the `should-start-on-boot` filter.

Fixes: https://issues.redhat.com/browse/RHEL-129405
Fixes: https://github.com/containers/podman/issues/20418

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-12-02 15:40:46 +01:00
Winter M
ed6f63af10 libpod: fix healthchecks not executing every interval on linux
By default, systemd sets a limit of how many times a service can start,
which means that if you have a healthcheck that runs more often than the
limits, systemd will refuse to start it with a message like "Start request
repeated too quickly." emitted to the journal.

Signed-off-by: Winter M <winter@antithesis.com>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-11-26 17:57:38 +01:00
Paul Holzinger
d163c38a26 vendor: update common, image, storage to main
This also then bumps github.com/opencontainers/runtime-spec to v1.3.0
which contains breaking changes of the pid type as such we had to update
all the podman callers.

And tags.cncf.io/container-device-interface also used some changed
types from it and they have been updated in main so bump to the latest
commit there as well in order to get podman to compile properly.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-11-21 14:24:29 +01:00
Aaron Ang
e0fc51eb68 Add ulimits to podman update API
Signed-off-by: Aaron Ang <aaron.angyd@gmail.com>
2025-11-20 22:59:50 -08:00
ryanmccann1024
61cbc0c3ee feat(exec): Add --no-session flag for improved performance
Fixes: #26588

For use cases like HPC, where `podman exec` is called in rapid succession, the standard exec process can become a bottleneck due to container locking and database I/O for session tracking.

This commit introduces a new `--no-session` flag to `podman exec`. When used, this flag invokes a new, lightweight backend implementation that:

- Skips container locking, reducing lock contention
- Bypasses the creation, tracking, and removal of exec sessions in the database
- Executes the command directly and retrieves the exit code without persisting session state
- Maintains consistency with regular exec for container lookup, TTY handling, and environment setup
- Shares implementation with health check execution to avoid code duplication

The implementation addresses all performance bottlenecks while preserving compatibility with existing exec functionality including --latest flag support and proper exit code handling.

Changes include:
- Add --no-session flag to cmd/podman/containers/exec.go
- Implement lightweight execution path in libpod/container_exec.go
- Ensure consistent container validation and environment setup
- Add comprehensive exit code testing including signal handling (exit 137)
- Optimize configuration to skip unnecessary exit command setup

Signed-off-by: Ryan McCann <ryan_mccann@student.uml.edu>
Signed-off-by: ryanmccann1024 <ryan_mccann@student.uml.edu>
2025-11-19 12:44:48 -05:00
openshift-merge-bot[bot]
af91cae1c5 Merge pull request #27271 from lsm5/podman6-no-cgv1
Podman6: Remove cgroupsv1
2025-11-14 17:03:59 +00:00
Nicola Sella
df4905d68b Remove hardcoded refs from ociartifact code
Fixes: https://issues.redhat.com/browse/RUN-3578

Signed-off-by: Nicola Sella <nsella@redhat.com>
2025-11-13 22:57:21 +01:00