13 Commits

Author SHA1 Message Date
88b62d2c27 vendor: update c/common
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-03-20 13:37:19 +01:00
1f44d0f8b2 libpod: report cgroups deleted during Stat() call
The cgroup.Stat() operation is not atomic, so it's possible that the
cgroup is removed during the Stat() call.  Catch specific errors that
can occur when the cgroup is missing and validate the existence of the
cgroup path.
If the cgroup is not found, return a more specific error indicating
that the container has been removed.

Closes: https://github.com/containers/podman/issues/23789

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-10-29 11:16:57 +01:00
1600cfffa5 Fix some comments
Signed-off-by: fanqiaojun <fanqiaojun@yeah.net>
2024-04-13 15:20:19 +08:00
72f1617fac Bump Go module to v5
Moving from Go module v4 to v5 prepares us for public releases.

Move done using gomove [1] as with the v3 and v4 moves.

[1] https://github.com/KSubedi/gomove

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-08 09:35:39 -05:00
6e0decbe03 Send container stats over API on a per-interface basis
This mirrors how the Docker API handles things, allowing us to be
more compatible with Docker and more verbose on the Libpod API.
Stats are given as per network interface in the container, but
still aggregated for `podman stats` and `podman pod stats`
display (so the CLI does not change, only the Libpod and Compat
APIs).

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-06 17:05:07 -05:00
2a2d0b0e18 chore: delete obsolete // +build lines
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2024-01-04 11:53:38 +02:00
bad25da92e libpod: add !remote tag
This should never be pulled into the remote client.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-24 12:11:34 +02:00
5c7d50f08c Fix: display online_cpus in compat REST API
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2023-05-31 07:41:30 +03:00
7c53a463b2 stats: get mem limit from the cgroup
b25b330306782019d7aaf7618cd4598a9ae87250 introduced this behaviour.

It was fine at the time because we didn't support "container update",
so the limit could not be changed at runtime.  Since it is not
possible to change the memory limit at runtime, read the limit as
reported from the cgroup.

https://github.com/containers/crun/pull/1217 is required for crun.

Closes: https://github.com/containers/podman/issues/18621

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-05-19 14:59:43 +02:00
75f6a1d596 Fix swapped NetInput/-Output stats
Fix swapped NetInput and NetOutput container stats. This resulted
in `podman stats` showing outgoing traffic as NetInput and incoming
traffic as NetOutput. This change might be visible or cause problems
for users who are actively relying on those stats for monitoring reasons.

[NO NEW TEST NEEDED]

Signed-off-by: Ingo Becker <ingo@orgizm.net>
2022-11-28 12:26:41 +01:00
55191ecc20 Add and use Container.LinuxResource() helper
This gets c.config.Spec.Linux.Resources, with some nil checks.
Using this means less open coding of the nil-checks, but also the
existing user of this field in moveConmonToCgroupAndSignal() was
using ctr.Spec().Linux.Resources instead, and the Spec() call
is very expensive.

[NO NEW TESTS NEEDED] Just minor performance effects

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-12 13:45:49 +02:00
b3e978e43b libpod: Split out the common code from GetContainerStats
This moves the cgroups code to a new method getPlatformContainerStats.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-14 08:29:26 +01:00
47bd9e8110 libpod: Move stats.go to stats_linux.go for consistency
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-14 08:29:26 +01:00