mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
kubevirt: Fix RS and presets template parameters (#56865)
This commit is contained in:
@@ -129,8 +129,11 @@ class KubeVirtVMPreset(KubeVirtRawModule):
|
|||||||
# attributes there, remove when we do:
|
# attributes there, remove when we do:
|
||||||
definition['spec']['domain']['devices'] = dict()
|
definition['spec']['domain']['devices'] = dict()
|
||||||
|
|
||||||
|
# defaults for template
|
||||||
|
defaults = {'disks': [], 'volumes': [], 'interfaces': [], 'networks': []}
|
||||||
|
|
||||||
# Execute the CURD of VM:
|
# Execute the CURD of VM:
|
||||||
dummy, definition = self.construct_vm_definition(KIND, definition, definition)
|
dummy, definition = self.construct_vm_definition(KIND, definition, definition, defaults)
|
||||||
result_crud = self.execute_crud(KIND, definition)
|
result_crud = self.execute_crud(KIND, definition)
|
||||||
changed = result_crud['changed']
|
changed = result_crud['changed']
|
||||||
result = result_crud.pop('result')
|
result = result_crud.pop('result')
|
||||||
|
|||||||
@@ -173,9 +173,12 @@ class KubeVirtVMIRS(KubeVirtRawModule):
|
|||||||
if replicas is not None:
|
if replicas is not None:
|
||||||
definition['spec']['replicas'] = replicas
|
definition['spec']['replicas'] = replicas
|
||||||
|
|
||||||
|
# defaults for template
|
||||||
|
defaults = {'disks': [], 'volumes': [], 'interfaces': [], 'networks': []}
|
||||||
|
|
||||||
# Execute the CURD of VM:
|
# Execute the CURD of VM:
|
||||||
template = definition['spec']['template']
|
template = definition['spec']['template']
|
||||||
dummy, definition = self.construct_vm_definition(KIND, definition, template)
|
dummy, definition = self.construct_vm_definition(KIND, definition, template, defaults)
|
||||||
result_crud = self.execute_crud(KIND, definition)
|
result_crud = self.execute_crud(KIND, definition)
|
||||||
changed = result_crud['changed']
|
changed = result_crud['changed']
|
||||||
result = result_crud.pop('result')
|
result = result_crud.pop('result')
|
||||||
|
|||||||
Reference in New Issue
Block a user