Fix namespace historical analysis - use Kubernetes API for accurate pod count and remove duplicate function

This commit is contained in:
2025-09-29 14:07:49 -03:00
parent c15ce4557a
commit 514ea60274
3 changed files with 26 additions and 60 deletions

View File

@@ -485,6 +485,7 @@ async def get_cluster_historical_summary(
async def get_namespace_historical_analysis(
namespace: str,
time_range: str = "24h",
k8s_client=Depends(get_k8s_client),
prometheus_client=Depends(get_prometheus_client)
):
"""Get historical analysis for a specific namespace"""
@@ -493,7 +494,7 @@ async def get_namespace_historical_analysis(
# Get historical analysis for the namespace
analysis = await historical_service.get_namespace_historical_analysis(
namespace, time_range
namespace, time_range, k8s_client
)
return {