Skip to content

Commit

Permalink
Merge pull request #217 from robusta-dev/bugfix-prometrix-compat
Browse files Browse the repository at this point in the history
Fix bug that caused a fallback to loading pod names from the APIServer and not Prometheus
  • Loading branch information
arikalon1 authored Mar 2, 2024
2 parents 4b87b60 + cf9533e commit dafadf8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ async def load_pods(self, object: K8sObjectData, period: datetime.timedelta) ->
}}[{period_literal}]
"""
)
replicasets = replicasets["result"]
pod_owners = [replicaset["metric"]["replicaset"] for replicaset in replicasets]
pod_owner_kind = "ReplicaSet"

Expand All @@ -211,6 +212,7 @@ async def load_pods(self, object: K8sObjectData, period: datetime.timedelta) ->
)
"""
)
related_pods_result = related_pods_result["result"]

if related_pods_result == []:
return []
Expand All @@ -231,6 +233,7 @@ async def load_pods(self, object: K8sObjectData, period: datetime.timedelta) ->
}} == 1
"""
)
pods_status_result = pods_status_result["result"]
current_pods_set |= {pod["metric"]["pod"] for pod in pods_status_result}
del pods_status_result

Expand Down

0 comments on commit dafadf8

Please sign in to comment.