1
0
mirror of https://github.com/containers/podman.git synced 2026-02-05 15:45:08 +01:00

4487 Commits

Author SHA1 Message Date
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
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