diff options
author | Russell Teague <rteague@redhat.com> | 2017-01-31 08:05:03 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-31 08:05:03 -0500 |
commit | fca215887b2e4224779b58e8fd1b7662ec993f83 (patch) | |
tree | a8862a16c39d54dc5f123fff532904da371794e1 /roles/openshift_master_facts/lookup_plugins/openshift_master_facts_default_priorities.py | |
parent | e6bec56b75baa631cdb4902d29cca811db91e9f1 (diff) | |
parent | bc2ba98351a4b45a18813cf2dc2cd58f098bc1d3 (diff) | |
download | openshift-fca215887b2e4224779b58e8fd1b7662ec993f83.tar.gz openshift-fca215887b2e4224779b58e8fd1b7662ec993f83.tar.bz2 openshift-fca215887b2e4224779b58e8fd1b7662ec993f83.tar.xz openshift-fca215887b2e4224779b58e8fd1b7662ec993f83.zip |
Merge pull request #3194 from mtnbikenc/upgrade-3_5-fork
Create v3_5 upgrade playbooks
Diffstat (limited to 'roles/openshift_master_facts/lookup_plugins/openshift_master_facts_default_priorities.py')
-rw-r--r-- | roles/openshift_master_facts/lookup_plugins/openshift_master_facts_default_priorities.py | 61 |
1 files changed, 45 insertions, 16 deletions
diff --git a/roles/openshift_master_facts/lookup_plugins/openshift_master_facts_default_priorities.py b/roles/openshift_master_facts/lookup_plugins/openshift_master_facts_default_priorities.py index 36022597f..95ace7923 100644 --- a/roles/openshift_master_facts/lookup_plugins/openshift_master_facts_default_priorities.py +++ b/roles/openshift_master_facts/lookup_plugins/openshift_master_facts_default_priorities.py @@ -11,11 +11,7 @@ class LookupModule(LookupBase): def run(self, terms, variables=None, zones_enabled=True, short_version=None, deployment_type=None, **kwargs): - priorities = [ - {'name': 'LeastRequestedPriority', 'weight': 1}, - {'name': 'BalancedResourceAllocation', 'weight': 1}, - {'name': 'SelectorSpreadPriority', 'weight': 1} - ] + priorities = [] if short_version is None or deployment_type is None: if 'openshift' not in variables: @@ -57,18 +53,51 @@ class LookupModule(LookupBase): # convert short_version to origin short_version short_version = re.sub('^3.', '1.', short_version) - if short_version == '1.4': - priorities.append({'name': 'NodePreferAvoidPodsPriority', 'weight': 10000}) - - # only 1.1 didn't include NodeAffinityPriority - if short_version != '1.1': - priorities.append({'name': 'NodeAffinityPriority', 'weight': 1}) + if short_version == '1.1': + priorities.extend([ + {'name': 'LeastRequestedPriority', 'weight': 1}, + {'name': 'BalancedResourceAllocation', 'weight': 1}, + {'name': 'SelectorSpreadPriority', 'weight': 1} + ]) + + if short_version == '1.2': + priorities.extend([ + {'name': 'LeastRequestedPriority', 'weight': 1}, + {'name': 'BalancedResourceAllocation', 'weight': 1}, + {'name': 'SelectorSpreadPriority', 'weight': 1}, + {'name': 'NodeAffinityPriority', 'weight': 1} + ]) + + if short_version == '1.3': + priorities.extend([ + {'name': 'LeastRequestedPriority', 'weight': 1}, + {'name': 'BalancedResourceAllocation', 'weight': 1}, + {'name': 'SelectorSpreadPriority', 'weight': 1}, + {'name': 'NodeAffinityPriority', 'weight': 1}, + {'name': 'TaintTolerationPriority', 'weight': 1} + ]) - if short_version not in ['1.1', '1.2']: - priorities.append({'name': 'TaintTolerationPriority', 'weight': 1}) - - if short_version not in ['1.1', '1.2', '1.3']: - priorities.append({'name': 'InterPodAffinityPriority', 'weight': 1}) + if short_version == '1.4': + priorities.extend([ + {'name': 'LeastRequestedPriority', 'weight': 1}, + {'name': 'BalancedResourceAllocation', 'weight': 1}, + {'name': 'SelectorSpreadPriority', 'weight': 1}, + {'name': 'NodePreferAvoidPodsPriority', 'weight': 10000}, + {'name': 'NodeAffinityPriority', 'weight': 1}, + {'name': 'TaintTolerationPriority', 'weight': 1}, + {'name': 'InterPodAffinityPriority', 'weight': 1} + ]) + + if short_version in ['1.5', '1.6']: + priorities.extend([ + {'name': 'SelectorSpreadPriority', 'weight': 1}, + {'name': 'InterPodAffinityPriority', 'weight': 1}, + {'name': 'LeastRequestedPriority', 'weight': 1}, + {'name': 'BalancedResourceAllocation', 'weight': 1}, + {'name': 'NodePreferAvoidPodsPriority', 'weight': 10000}, + {'name': 'NodeAffinityPriority', 'weight': 1}, + {'name': 'TaintTolerationPriority', 'weight': 1} + ]) if zones_enabled: zone_priority = { |