Commit fe3120c9 authored by Daniele Venzano's avatar Daniele Venzano

Propagate labels up to the scheduler

parent a422b9f5
......@@ -73,6 +73,7 @@ class DockerStateSynchronizer(threading.Thread):
time.sleep(CHECK_INTERVAL)
continue
node_stats.status = 'online'
node_stats.labels = host_config.labels
service_list = self.state.service_list(backend_host=host_config.name)
try:
......@@ -111,6 +112,7 @@ class DockerStateSynchronizer(threading.Thread):
node_stats.container_count = info['Containers']
node_stats.cores_total = info['NCPU']
node_stats.memory_total = info['MemTotal']
node_stats.labels += info['Labels']
stats = {}
for cont in container_list:
......
......@@ -22,6 +22,7 @@ class SimulatedNode:
self.real_active_containers = real_node.container_count
self.services = []
self.name = real_node.name
self.labels = real_node.labels
def service_fits(self, service: Service) -> bool:
"""Checks whether a service can fit in this node"""
......
......@@ -39,7 +39,7 @@ class NodeStats(Stats):
self.memory_total = 0
self.memory_reserved = 0
self.memory_in_use = 0
self.labels = {}
self.labels = []
self.status = None
self.error = ''
self.services = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment