Commit 6e89d58e authored by Daniele Venzano's avatar Daniele Venzano

Support expanding the proxy path in the url template

Do not set multiple times the cleaning up status
parent 52feb452
......@@ -210,11 +210,12 @@ class APIEndpoint:
services_info.append(self.service_by_id(user, service.id))
for port in service.ports:
if port.external_ip is not None:
endpoint = port.url_template.format(**{"ip_port": port.external_ip + ":" + str(port.external_port)})
if zoe_lib.config.get_conf().traefik_zk_ips is None or not port.enable_proxy:
endpoint = port.url_template.format(**{"ip_port": port.external_ip + ":" + str(port.external_port)})
endpoint_ext = None
else:
endpoint_ext = '{}/{}'.format(zoe_lib.config.get_conf().traefik_base_url, port.proxy_key())
endpoint = port.url_template.format(**{"ip_port": port.external_ip + ":" + str(port.external_port), "proxy_path": endpoint_ext})
endpoints.append((port.readable_name, endpoint, endpoint_ext))
return services_info, endpoints
......
......@@ -111,7 +111,6 @@ class ZoeElasticScheduler:
def _terminate_executions(self):
while len(self.queue_termination) > 0:
execution = self.queue_termination.pop(0)
execution.set_cleaning_up()
try:
self.queue.remove(execution)
except ValueError:
......@@ -331,7 +330,6 @@ class ZoeElasticScheduler:
if service.essential and service.backend_status == service.BACKEND_DIE_STATUS:
log.info("Essential service {} ({}) of execution {} died, terminating execution".format(service.id, service.name, execution.id))
service.restarted()
execution.set_cleaning_up()
self.terminate(execution)
break
# Check for executions that need to be re-queued because one of the elastic components died
......
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