Skip to content

Commit

Permalink
fix: containers (podman) - handle dead infra container with active ch…
Browse files Browse the repository at this point in the history
…ildren
  • Loading branch information
RazCrimson committed Jun 16, 2024
1 parent 993ef01 commit 8b4ef8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions glances/plugins/containers/engines/podman.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ def _compute_activity_stats(self) -> Dict[str, Dict[str, Any]]:
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()),
Expand Down

0 comments on commit 8b4ef8c

Please sign in to comment.