From 78eb8b22b5bdd57bb16ea42c090a3087b9b128a6 Mon Sep 17 00:00:00 2001 From: Kyriakos Oikonomakos Date: Wed, 27 Jan 2021 22:41:41 +0000 Subject: [PATCH] Fix missing vapp properties Due to the way maps behave in goland we ended up removing data from the original map holding the vapp properties. The consequence was that if expandVAppConfig was called more than once, we'd end up effectively emptying the vapp properties map. --- vsphere/virtual_machine_config_structure.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vsphere/virtual_machine_config_structure.go b/vsphere/virtual_machine_config_structure.go index c0f52c060..e07b5be6d 100644 --- a/vsphere/virtual_machine_config_structure.go +++ b/vsphere/virtual_machine_config_structure.go @@ -628,7 +628,9 @@ func expandVAppConfig(d *schema.ResourceData, client *govmomi.Client) (*types.Vm if newVApps != nil && len(newVApps) > 0 && newVApps[0] != nil { newVApp := newVApps[0].(map[string]interface{}) if props, ok := newVApp["properties"].(map[string]interface{}); ok { - newMap = props + for k, v := range props { + newMap[k] = v + } } }