Skip to content

Commit

Permalink
fix attributes names (#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
RoiGlinik authored Jun 29, 2023
1 parent f9a0b44 commit 2060543
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/robusta/core/model/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -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):
Expand Down

0 comments on commit 2060543

Please sign in to comment.