Skip to content

Commit

Permalink
Fix bug that caused a fallback to loading pod names from the APIServe…
Browse files Browse the repository at this point in the history
…r and not Prometheus
  • Loading branch information
aantn committed Mar 2, 2024
1 parent 4b87b60 commit cf9533e
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 cf9533e

Please sign in to comment.