diff --git a/plugins/products/bosh-init/fixtures/vsphere-manifest-no-resourcepools.yml b/plugins/products/bosh-init/fixtures/vsphere-manifest-no-resourcepools.yml index 8bc529e..f928d02 100644 --- a/plugins/products/bosh-init/fixtures/vsphere-manifest-no-resourcepools.yml +++ b/plugins/products/bosh-init/fixtures/vsphere-manifest-no-resourcepools.yml @@ -9,5 +9,5 @@ datacenters: template_folder: pcf_templates vm_folder: pcf_vms clusters: - - PCF1 - - PCF2 + - PCF1: {} + - PCF2: {} diff --git a/plugins/products/bosh-init/vsphere.go b/plugins/products/bosh-init/vsphere.go index 1fbbfb3..52cab1e 100644 --- a/plugins/products/bosh-init/vsphere.go +++ b/plugins/products/bosh-init/vsphere.go @@ -216,23 +216,21 @@ func (v *VSphereBosh) getDataStorePattern() (pattern string) { return fmt.Sprintf("^(%s)$", v.cfg.VSphereDataStore) } func (v *VSphereBosh) clusterConfig() interface{} { - if len(v.cfg.VSphereResourcePool) > 0 { - clusters := make([]map[string]*ResourcePool, 0) + clusters := make([]map[string]interface{}, 0) - for index, clusterName := range v.cfg.VSphereClusters { - cluster := make(map[string]*ResourcePool) + for index, clusterName := range v.cfg.VSphereClusters { + cluster := make(map[string]interface{}) - if len(v.cfg.VSphereResourcePool) > index { - cluster[clusterName] = &ResourcePool{ - ResourcePool: v.cfg.VSphereResourcePool[index], - } + if len(v.cfg.VSphereResourcePool) > index { + cluster[clusterName] = &ResourcePool{ + ResourcePool: v.cfg.VSphereResourcePool[index], } - clusters = append(clusters, cluster) - + } else { + cluster[clusterName] = make(map[string]string, 0) } - return clusters - } else { - return v.cfg.VSphereClusters + clusters = append(clusters, cluster) } + return clusters + }