1
0
mirror of https://github.com/containers/podman.git synced 2026-02-05 06:45:31 +01:00
Commit Graph

4481 Commits

Author SHA1 Message Date
Brent Baude
b60d234da4 Merge pull request #27827 from lsm5/podman6-no-cni
Podman6: Remove CNI
2026-01-28 10:20:56 -06: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
Lokesh Mandvekar
96aba07d95 libpod/container_internal.go: util.SizeOfPath -> directory.Size
- Remove deprecated util.SizeOfPath

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:35:29 -05:00
Lokesh Mandvekar
f11392c719 Remove deprecated fields ctrConfig.[StaticIP,StaticMAC]
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:35:29 -05:00
Lokesh Mandvekar
a3fcf52a1c Fix deprecation notice to make gocritic happy.
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:35:29 -05:00
Lokesh Mandvekar
145540fed4 Remove ContainerStats.PerCPU: CGV1 only
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:15:34 -05:00
Lokesh Mandvekar
c98c50ec76 libpod/pod_api.go: Remove Cgroups v1
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:15:33 -05:00
Lokesh Mandvekar
06bc277ad8 libpod/util_linux.go: Remove Cgroups v1
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:15:33 -05:00
Lokesh Mandvekar
a12b3e97d2 libpod/runtime.go: Remove Cgroups v1
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:15:33 -05:00
Lokesh Mandvekar
faa551a921 libpod/runtime_ctr.go: Remove Cgroups v1
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:15:33 -05:00
Lokesh Mandvekar
cb91d90835 libpod/runtime_pod_linux.go: Remove Cgroups v1
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:15:32 -05:00
Lokesh Mandvekar
5499b79c8e libpod/runtime_linux.go: Remove Cgroups v1
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:15:32 -05:00
Lokesh Mandvekar
7c45f43a46 libpod/info_linux.go: Remove Cgroups v1
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:15:32 -05:00
Lokesh Mandvekar
4d404f1f1d libpod/container_internal*.go: Remove Cgroups v1
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:15:32 -05:00
Paul Holzinger
5c1ed12d8d enable gofumpt formatter
Based on our discussion gofumpt won the vote so use that one via
golangci-lint.

https://github.com/containers/podman/discussions/27291

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-11-11 12:32:46 +01:00
Paul Holzinger
a6f1c63c19 fix lint issues with github.com/cyphar/filepath-securejoin
The old location is deprecated and has been removed in v0.6.0 even. I
did this as extra commit to make cherry-picking easier.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-11-06 16:33:19 +01:00
Paul Holzinger
47ab0f1e94 update github.com/opencontainers/cgroups to v0.0.6
Includes one small fix for a breaking change in a type.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-11-06 14:39:04 +01:00
Matt Heon
f5bc2abe4c Remove BoltDB state support
This also includes a number of significant changes to the SQLite
state made possible by removal of the legacy DB.

1. Enable database unit tests for SQLite state, with numerous
   tweaks to get tests passing. Most notable changes are to
   container removal - where we previously didn't return an error
   if there was no container to remove - and RemovePodContainers,
   which I don't think ever worked properly from my reading of
   the failures.
2. Removal of AddContainerToPod/RemoveContainerToPod. On SQLite,
   these functions are identical to AddContainer/RemoveContainer
   and there is no reason to retain duplicates.
3. Removal of SafeRewriteContainerConfig - it's identical to
   RewriteContainerConfig in SQLite, no reason to have duplicate
   entrypoints.

As an exciting side-note, this removes Podman's requirement that
containers and pods cannot share a name, which was a BoltDB
restriction only.

Signed-off-by: Matt Heon <matthew.heon@pm.me>
2025-10-28 12:09:04 -04:00
Matt Heon
34166fc004 Bump Go version to v6
Tremendous amount of changes in here, but all should amount to
the same thing: changing Go import paths from v5 to v6.

Also bumped go.mod to github.com/containers/podman/v6 and updated
version to v6.0.0-dev.

Signed-off-by: Matt Heon <mheon@redhat.com>
2025-10-23 11:00:15 -04:00
Matt Heon
9ea18b78fa Warn on boltdb use
We started logging this in 5.6. In 5.7, we up to a warning. The
upcoming 5.8 will up the warnings further to errors.

Required as we're removing BoltDB support in 6.0 next Spring.

Signed-off-by: Matt Heon <matthew.heon@pm.me>
2025-10-22 09:24:43 -04:00
openshift-merge-bot[bot]
1a8eb18b2b Merge pull request #27310 from mheon/default-runtime-flags
Add support for runtime flags in containers.conf
2025-10-20 10:57:46 +00:00