Skip to content

Commit

Permalink
fix exception when theres no metrics source
Browse files Browse the repository at this point in the history
  • Loading branch information
RoiGlinik committed Dec 19, 2024
1 parent 644d66e commit ffaf3ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion robusta_krr/core/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ async def _collect_result(self) -> Result:
if not clusters or len(clusters) == 1:
cluster_name = clusters[0] if clusters else None # its none if krr is running inside cluster
prometheus_loader = self._get_prometheus_loader(cluster_name)
cluster_summary = await prometheus_loader.get_cluster_summary()
if prometheus_loader:
cluster_summary = await prometheus_loader.get_cluster_summary()
else:
cluster_summary = {}
else:
cluster_summary = {}
scans = await asyncio.gather(*[self._gather_object_allocations(k8s_object) for k8s_object in workloads])
Expand Down

0 comments on commit ffaf3ff

Please # to comment.