Skip to content
This repository has been archived by the owner on Jul 12, 2018. It is now read-only.

Commit

Permalink
[#133472471] adding support to provision when no resource pools are c…
Browse files Browse the repository at this point in the history
…onfigured must be array of empty map
  • Loading branch information
Caleb Washburn committed Feb 8, 2017
1 parent 252bc5d commit 4977845
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ datacenters:
template_folder: pcf_templates
vm_folder: pcf_vms
clusters:
- PCF1
- PCF2
- PCF1: {}
- PCF2: {}
24 changes: 11 additions & 13 deletions plugins/products/bosh-init/vsphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

0 comments on commit 4977845

Please sign in to comment.