Skip to content

Commit

Permalink
[vsphere] Fix panic if vsphere returns none NotFound error.
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolay Mitrofanov <[email protected]>
  • Loading branch information
name212 committed Feb 12, 2024
1 parent bc20282 commit 09a5a32
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/driver/driver_vsphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ func (d *VsphereDriver) Create() (string, string, error) {
} else if err != nil {
return d.encodeMachineID(machineID), "", NewCreateFailErr(fmt.Errorf("failed to find datastore %q: %s", dsPath, err), sideEffectsPresent)
}
} else if err != nil {
klog.V(1).Infof("Getting DatastoreCluster by path %q returns error %v", dsPath, err)
return d.encodeMachineID(machineID), "", NewCreateFailErr(fmt.Errorf("failed to find datastore %q: %s", dsPath, err), sideEffectsPresent)
}

vmTemplate, err := finder.VirtualMachine(ctx, path.Join("/", datacenter.Name(), "vm", d.VsphereMachineClass.Spec.Template))
Expand Down

0 comments on commit 09a5a32

Please sign in to comment.