Ensure coe_cluster_template compare labels properly
SDK does return all keys and values of the template labels as strings. At the same time user can define some labels as integers or booleans, which will break comparison of labels and lead to module failure on consecutive runs. Change-Id: I7ab624428c8bb06030a2b28888f5cb89bb249f08
This commit is contained in:
parent
e6379e3038
commit
40a384214c
@ -0,0 +1,7 @@
|
||||
---
|
||||
|
||||
bugfixes:
|
||||
- |
|
||||
coe_cluster_template - now labels are converted to strings by module that
|
||||
fixes module idempotence in case label values defined by users are
|
||||
integers or booleans.
|
@ -26,6 +26,9 @@
|
||||
keypair_id: '{{ keypair.keypair.id }}'
|
||||
name: k8s
|
||||
state: present
|
||||
labels:
|
||||
docker_volume_size: 10
|
||||
cloud_provider_tag: v1.23.1
|
||||
register: coe_cluster_template
|
||||
|
||||
- name: Assert return values of coe_cluster_template module
|
||||
@ -43,6 +46,9 @@
|
||||
keypair_id: '{{ keypair.keypair.id }}'
|
||||
name: k8s
|
||||
state: present
|
||||
labels:
|
||||
docker_volume_size: 10
|
||||
cloud_provider_tag: v1.23.1
|
||||
register: coe_cluster_template
|
||||
|
||||
- name: Assert return values of coe_cluster_template module
|
||||
|
@ -433,6 +433,9 @@ class COEClusterTemplateModule(OpenStackModule):
|
||||
if isinstance(labels, str):
|
||||
labels = dict([tuple(kv.split(":"))
|
||||
for kv in labels.split(",")])
|
||||
elif isinstance(labels, dict):
|
||||
labels = dict({str(k): str(v)
|
||||
for k, v in labels.items()})
|
||||
if labels != cluster_template['labels']:
|
||||
non_updateable_keys.append('labels')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user