Skip to content

Commit

Permalink
remove redundant cast
Browse files Browse the repository at this point in the history
Signed-off-by: Arik Hadas <[email protected]>
  • Loading branch information
ahadas committed May 15, 2024
1 parent a785db8 commit 99589bc
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/controller/provider/container/vsphere/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,8 @@ func (v *VmAdapter) updateDisks(devArray *types.ArrayOfVirtualDevice) {
switch dev.(type) {
case *types.VirtualDisk:
disk := dev.(*types.VirtualDisk)
switch disk.Backing.(type) {
switch backing := disk.Backing.(type) {
case *types.VirtualDiskFlatVer1BackingInfo:
backing := disk.Backing.(*types.VirtualDiskFlatVer1BackingInfo)
md := model.Disk{
Key: disk.Key,
File: backing.FileName,
Expand All @@ -702,7 +701,6 @@ func (v *VmAdapter) updateDisks(devArray *types.ArrayOfVirtualDevice) {
}
disks = append(disks, md)
case *types.VirtualDiskFlatVer2BackingInfo:
backing := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo)
md := model.Disk{
Key: disk.Key,
File: backing.FileName,
Expand All @@ -718,7 +716,6 @@ func (v *VmAdapter) updateDisks(devArray *types.ArrayOfVirtualDevice) {
}
disks = append(disks, md)
case *types.VirtualDiskRawDiskMappingVer1BackingInfo:
backing := disk.Backing.(*types.VirtualDiskRawDiskMappingVer1BackingInfo)
md := model.Disk{
Key: disk.Key,
File: backing.FileName,
Expand All @@ -735,7 +732,6 @@ func (v *VmAdapter) updateDisks(devArray *types.ArrayOfVirtualDevice) {
}
disks = append(disks, md)
case *types.VirtualDiskRawDiskVer2BackingInfo:
backing := disk.Backing.(*types.VirtualDiskRawDiskVer2BackingInfo)
md := model.Disk{
Key: disk.Key,
File: backing.DescriptorFileName,
Expand Down

0 comments on commit 99589bc

Please sign in to comment.