Add state attribute to KubernetesPod
@@ -37,7 +37,7 @@ ROOT_URL = "/api/"
class KubernetesPod(object):
- def __init__(self, id, name, containers, namespace):
+ def __init__(self, id, name, containers, namespace, state):
"""
A Kubernetes pod
"""
@@ -45,6 +45,7 @@ class KubernetesPod(object):
self.name = name
self.containers = containers
self.namespace = namespace
+ self.state = state
class KubernetesContainerDriver(KubernetesDriverMixin, ContainerDriver):
@@ -250,6 +251,7 @@ class KubernetesContainerDriver(KubernetesDriverMixin, ContainerDriver):
id=data["metadata"]["uid"],
name=data["metadata"]["name"],
namespace=data["metadata"]["namespace"],
+ state=data["status"]["phase"].lower(),
containers=containers,
)
