Allow overwriting labels on swarm mode creation
Allow passing label values on cluster creation for swarm mode. This is available in all kubernetes drivers as well as swarm, but somehow missed on swarm mode. Story: 2004942 Task: 29343 Change-Id: Ie3ac66f45e27cc92993116c3df0b33873dc67e24
This commit is contained in:
parent
a4164eddd8
commit
b555f90c10
@ -135,11 +135,11 @@ class SwarmModeTemplateDefinition(template_def.BaseTemplateDefinition):
|
||||
CONF.cluster.nodes_affinity_policy
|
||||
|
||||
for label in label_list:
|
||||
extra_params[label] = cluster_template.labels.get(label)
|
||||
extra_params[label] = cluster.labels.get(label)
|
||||
|
||||
# set docker_volume_type
|
||||
# use the configuration default if None provided
|
||||
docker_volume_type = cluster_template.labels.get(
|
||||
docker_volume_type = cluster.labels.get(
|
||||
'docker_volume_type', CONF.cinder.default_docker_volume_type)
|
||||
extra_params['docker_volume_type'] = docker_volume_type
|
||||
|
||||
|
@ -1169,10 +1169,10 @@ class AtomicSwarmModeTemplateDefinitionTestCase(base.TestCase):
|
||||
mock_context.user_name = 'fake_user'
|
||||
mock_context.tenant = 'fake_tenant'
|
||||
|
||||
docker_volume_type = mock_cluster_template.labels.get(
|
||||
docker_volume_type = mock_cluster.labels.get(
|
||||
'docker_volume_type')
|
||||
rexray_preempt = mock_cluster_template.labels.get('rexray_preempt')
|
||||
availability_zone = mock_cluster_template.labels.get(
|
||||
rexray_preempt = mock_cluster.labels.get('rexray_preempt')
|
||||
availability_zone = mock_cluster.labels.get(
|
||||
'availability_zone')
|
||||
|
||||
number_of_secondary_masters = mock_cluster.master_count - 1
|
||||
|
5
releasenotes/notes/bug-2004942-052321df27529562.yaml
Normal file
5
releasenotes/notes/bug-2004942-052321df27529562.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Allow overriding cluster template labels for swarm mode clusters - this
|
||||
functionality was missed from this COE when it was introduced.
|
Loading…
Reference in New Issue
Block a user