Add node_name attribute to KubernetesPod
@@ -45,9 +45,8 @@ ROOT_URL = "/api/"
class KubernetesPod(object):
- def __init__(
- self, id, name, containers, namespace, state, ip_addresses, created_at
- ):
+ def __init__(self, id, name, containers, namespace, state, ip_addresses,
+ created_at, node_name):
"""
A Kubernetes pod
"""
@@ -58,6 +57,7 @@ class KubernetesPod(object):
self.state = state
self.ip_addresses = ip_addresses
self.created_at = created_at
+ self.node_name = node_name
class KubernetesContainerDriver(KubernetesDriverMixin, ContainerDriver):
@@ -346,7 +346,7 @@ class KubernetesContainerDriver(KubernetesDriverMixin, ContainerDriver):
ip_addresses=ip_addresses,
containers=containers,
created_at=created_at,
- )
+ node_name=data['spec'].get('nodeName'))
def _to_container(self, data, container_status, pod_data):
"""
