From 260d8114c570f456448210c7a5330ddc6d91ea6c Mon Sep 17 00:00:00 2001 From: andersonid Date: Thu, 2 Oct 2025 08:20:44 -0300 Subject: [PATCH] Fix container data structure access in SmartRecommendationsService --- app/services/smart_recommendations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/smart_recommendations.py b/app/services/smart_recommendations.py index 11c19cf..4f6eb25 100644 --- a/app/services/smart_recommendations.py +++ b/app/services/smart_recommendations.py @@ -118,12 +118,12 @@ class SmartRecommendationsService: # Analyze resource configuration has_requests = all( - any(container.resources.get("requests") for container in pod.containers) + any(container.get("resources", {}).get("requests") for container in pod.containers) for pod in pods ) has_limits = all( - any(container.resources.get("limits") for container in pod.containers) + any(container.get("resources", {}).get("limits") for container in pod.containers) for pod in pods ) @@ -131,7 +131,7 @@ class SmartRecommendationsService: has_optimal_ratios = True for pod in pods: for container in pod.containers: - resources = container.resources + resources = container.get("resources", {}) requests = resources.get("requests", {}) limits = resources.get("limits", {})