From 2060543bd64f88b770d97565e2bc0de2ca778175 Mon Sep 17 00:00:00 2001 From: Roi Glinik Date: Thu, 29 Jun 2023 15:06:45 +0300 Subject: [PATCH] fix attributes names (#957) --- src/robusta/core/model/services.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/robusta/core/model/services.py b/src/robusta/core/model/services.py index 84ae73059..b5a13e6ac 100644 --- a/src/robusta/core/model/services.py +++ b/src/robusta/core/model/services.py @@ -37,7 +37,9 @@ def get_container_info(container: V1Container) -> "ContainerInfo": limits = container.resources.limits if container.resources.limits else {} requests = container.resources.requests if container.resources.requests else {} resources = Resources(limits=limits, requests=requests) - return ContainerInfo(name=container.name, image=container.image, env=env, resources=resources) + ports = [p.container_port for p in container.ports] if container.ports else [] + return ContainerInfo(name=container.name, image=container.image, env=env, resources=resources, ports=ports) + @staticmethod def get_container_info_k8(container: Container) -> "ContainerInfo": @@ -49,7 +51,7 @@ def get_container_info_k8(container: Container) -> "ContainerInfo": limits = container.resources.limits if container.resources.limits else {} requests = container.resources.requests if container.resources.requests else {} resources = Resources(limits=limits, requests=requests) - ports = [p.container_port for p in container.ports] if container.ports else [] + ports = [p.containerPort for p in container.ports] if container.ports else [] return ContainerInfo(name=container.name, image=container.image, env=env, resources=resources, ports=ports) def __eq__(self, other):