Skip to content

Commit ffaf3ff

Browse files
committed
fix exception when theres no metrics source
1 parent 644d66e commit ffaf3ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

robusta_krr/core/runner.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,10 @@ async def _collect_result(self) -> Result:
289289
if not clusters or len(clusters) == 1:
290290
cluster_name = clusters[0] if clusters else None # its none if krr is running inside cluster
291291
prometheus_loader = self._get_prometheus_loader(cluster_name)
292-
cluster_summary = await prometheus_loader.get_cluster_summary()
292+
if prometheus_loader:
293+
cluster_summary = await prometheus_loader.get_cluster_summary()
294+
else:
295+
cluster_summary = {}
293296
else:
294297
cluster_summary = {}
295298
scans = await asyncio.gather(*[self._gather_object_allocations(k8s_object) for k8s_object in workloads])

0 commit comments

Comments
 (0)