From 1e05e7f2a245d6f68931e70dcf3af429484e3551 Mon Sep 17 00:00:00 2001 From: Dev <732525+devdattakulkarni@users.noreply.github.com> Date: Thu, 25 Jul 2024 05:07:07 -0500 Subject: [PATCH] Ignoring Succeeded Pods when calculating num_of_not_running pods (#1330) --- plugins/crmetrics.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/crmetrics.py b/plugins/crmetrics.py index e01b10d6..721f0ff9 100644 --- a/plugins/crmetrics.py +++ b/plugins/crmetrics.py @@ -237,7 +237,8 @@ def _num_of_not_running_pods(self, pod_list, kubecfg=''): num_of_not_running_pods = 0 for pod in pod_list: json_output = self._get_pod(pod, kubeconfig=kubecfg) - if json_output['status']['phase'] != 'Running': + phase = json_output['status']['phase'].strip() + if phase != 'Running' and phase != 'Succeeded': num_of_not_running_pods = num_of_not_running_pods + 1 return num_of_not_running_pods