From cb927ee59d3647a9a6590b1afb39050827984737 Mon Sep 17 00:00:00 2001 From: Baptiste Roux Date: Fri, 4 Aug 2023 11:42:55 +0200 Subject: [PATCH] fix(prometheus): Avoid appending duplicate pods --- .../prometheus/metrics_service/prometheus_metrics_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py b/robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py index b2cc1357..914c9e48 100644 --- a/robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py +++ b/robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py @@ -226,7 +226,7 @@ async def load_pods(self, object: K8sObjectData, period: datetime.timedelta) -> current_pods_set = {pod["metric"]["pod"] for pod in current_pods} del current_pods - object.pods += [ + object.pods += set([ PodData(name=pod["metric"]["pod"], deleted=pod["metric"]["pod"] not in current_pods_set) for pod in related_pods - ] + ])