mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
vSphere Cloud provider null pointer exception
SelectByType function in govmomi will panic if deviceType is not Array, Chan, Map, Ptr, or Slice. Also checking if vmDevices or vm are nil, there is nothing to cleanup.
This commit is contained in:
parent
dfccabe22f
commit
87e721367e
@ -570,6 +570,9 @@ func getVirtualMachineDevices(cfg *VSphereConfig, ctx context.Context, c *govmom
|
||||
|
||||
// Removes SCSI controller which is latest attached to VM.
|
||||
func cleanUpController(newSCSIController types.BaseVirtualDevice, vmDevices object.VirtualDeviceList, vm *object.VirtualMachine, ctx context.Context) error {
|
||||
if newSCSIController == nil || vmDevices == nil || vm == nil {
|
||||
return nil
|
||||
}
|
||||
ctls := vmDevices.SelectByType(newSCSIController)
|
||||
if len(ctls) < 1 {
|
||||
return ErrNoDevicesFound
|
||||
|
Loading…
Reference in New Issue
Block a user