summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com>2024-06-16 06:25:29 +0530
committerBharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com>2024-06-16 06:25:46 +0530
commit8b4ef8c2359e386145f4820c270c64f48b6aa03a (patch)
tree82d914469cfaf8667664593e2171adedb66b0cb4
parent993ef0107a0be7fcf273e2ab0f28fd538a9c317b (diff)
fix: containers (podman) - handle dead infra container with active children
-rw-r--r--glances/plugins/containers/engines/podman.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/glances/plugins/containers/engines/podman.py b/glances/plugins/containers/engines/podman.py
index a66accad..c913a58d 100644
--- a/glances/plugins/containers/engines/podman.py
+++ b/glances/plugins/containers/engines/podman.py
@@ -93,9 +93,9 @@ class PodmanContainerStatsFetcher:
stats["network"]['tx'] = api_stats["NetOutput"]
stats["network"]['time_since_update'] = 1
# Hardcode to 1 as podman already sends at the same fixed rate per second
- else:
+ elif api_stats["Network"] is not None:
+ # api_stats["Network"] can be None if the infra container of the pod is killed
# For podman in rootless mode
- # Note: No stats are being sent as of now in rootless mode. They are defaulting to 0 on podman end.
stats['network'] = {
"cumulative_rx": sum(interface["RxBytes"] for interface in api_stats["Network"].values()),
"cumulative_tx": sum(interface["TxBytes"] for interface in api_stats["Network"].values()),