Skip to content

Commit

Permalink
fix(vmware): allow deletion of VirtualDisk
Browse files Browse the repository at this point in the history
  • Loading branch information
n-rodriguez committed Feb 28, 2025
1 parent 1f9982e commit 773b3e2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions internal/netbox/inventory/delete_items.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,7 @@ func (nbi *NetboxInventory) softDelete(orphanItem objects.OrphanItem) error {
case *objects.IPAddress:
_, err = service.Patch[objects.IPAddress](nbi.OrphanManager.Ctx, nbi.NetboxAPI, orphanItem.GetID(), diffMap)
case *objects.VirtualDeviceContext:
_, err = service.Patch[objects.VirtualDeviceContext](
nbi.OrphanManager.Ctx,
nbi.NetboxAPI,
orphanItem.GetID(),
diffMap,
)
_, err = service.Patch[objects.VirtualDeviceContext](nbi.OrphanManager.Ctx, nbi.NetboxAPI, orphanItem.GetID(), diffMap)
case *objects.Interface:
_, err = service.Patch[objects.Interface](nbi.OrphanManager.Ctx, nbi.NetboxAPI, orphanItem.GetID(), diffMap)
case *objects.VMInterface:
Expand Down Expand Up @@ -130,6 +125,8 @@ func (nbi *NetboxInventory) softDelete(orphanItem objects.OrphanItem) error {
_, err = service.Patch[objects.WirelessLANGroup](nbi.OrphanManager.Ctx, nbi.NetboxAPI, orphanItem.GetID(), diffMap)
case *objects.MACAddress:
_, err = service.Patch[objects.MACAddress](nbi.OrphanManager.Ctx, nbi.NetboxAPI, orphanItem.GetID(), diffMap)
case *objects.VirtualDisk:
_, err = service.Patch[objects.VirtualDisk](nbi.OrphanManager.Ctx, nbi.NetboxAPI, orphanItem.GetID(), diffMap)
default:
return fmt.Errorf("unsupported type for orphan item%T", orphanItem)
}
Expand Down

0 comments on commit 773b3e2

Please sign in to comment.