Skip to content

Commit

Permalink
Fix to check if clusters are available in a datacenter
Browse files Browse the repository at this point in the history
  • Loading branch information
BaluDontu committed Oct 22, 2020
1 parent 24aa67c commit c6ec014
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/csi/service/common/vsphereutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,13 @@ func getDsToFileServiceEnabledMap(ctx context.Context, vc *vsphere.VirtualCenter
finder.SetDatacenter(datacenter.Datacenter)
clusterComputeResource, err := finder.ClusterComputeResourceList(ctx, "*")
if err != nil {
log.Errorf("Error occurred while getting clusterComputeResource. error: %+v", err)
return nil, err
if _, ok := err.(*find.NotFoundError); !ok {
log.Errorf("Error occurred while getting clusterComputeResource. error: %+v", err)
return nil, err
} else {
log.Debugf("No clusterComputeResource found in dc: %+v. error: %+v", datacenter, err)
continue
}
}

pc := property.DefaultCollector(datacenter.Client())
Expand Down

0 comments on commit c6ec014

Please sign in to comment.