Commit 9663d5f9 authored by ale's avatar ale
Browse files

Add a disabled: true attribute to services

All the attribute does right now is, it will skip host allocation for
the service.
parent caf29091
Pipeline #21500 passed with stage
in 4 minutes and 20 seconds
......@@ -522,7 +522,9 @@ class Assignments(object):
service = services[service_name]
available_hosts = cls._available_hosts(service, group_map)
num_instances = service.get('num_instances', 'all')
if num_instances == 'all':
if service.get('disabled'):
service_hosts = []
elif num_instances == 'all':
service_hosts = sorted(available_hosts)
else:
service_hosts = sorted(_binpack(
......@@ -530,7 +532,7 @@ class Assignments(object):
service_hosts_map[service_name] = service_hosts
for h in service_hosts:
host_occupation[h] += 1
if service.get('master_election'):
if service.get('master_election') and not service.get('disabled'):
if 'master_scheduling_group' in service:
available_hosts = set(available_hosts).intersection(
set(group_map[service['master_scheduling_group']]))
......
Supports Markdown
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