Skip to content

Commit

Permalink
fix(vmware): fallback on single host clusters when no cluster is dete…
Browse files Browse the repository at this point in the history
…cted
  • Loading branch information
n-rodriguez committed Mar 1, 2025
1 parent 1f9982e commit 48848b1
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions internal/source/vmware/vmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,20 @@ func (vc *VmwareSource) CreateClusterDataCenterRelation(
finder.SetDatacenter(dc)
clusters, err := finder.ClusterComputeResourceList(ctx, "*")
if err != nil {
return fmt.Errorf(
"finder failed finding clusters for datacenter %s: %s",
dc.InventoryPath,
err,
)
// fallback on single host clusters
clusters, err := finder.ComputeResourceList(ctx, "*")

if err != nil {
return fmt.Errorf(
"finder failed finding clusters for datacenter %s: %s",
dc.InventoryPath,
err,
)
}

for _, cluster := range clusters {
vc.Cluster2Datacenter[cluster.Reference().Value] = dc.Reference().Value
}
}
for _, cluster := range clusters {
vc.Cluster2Datacenter[cluster.Reference().Value] = dc.Reference().Value
Expand Down

0 comments on commit 48848b1

Please sign in to comment.