From 99589bc8f80b241e93ee434652aeb068e9167086 Mon Sep 17 00:00:00 2001 From: Arik Hadas Date: Tue, 9 Apr 2024 12:09:51 +0300 Subject: [PATCH] remove redundant cast Signed-off-by: Arik Hadas --- pkg/controller/provider/container/vsphere/model.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/controller/provider/container/vsphere/model.go b/pkg/controller/provider/container/vsphere/model.go index 63cb19904..47f77fac1 100644 --- a/pkg/controller/provider/container/vsphere/model.go +++ b/pkg/controller/provider/container/vsphere/model.go @@ -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, @@ -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, @@ -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, @@ -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,