Skip to content

Commit

Permalink
fix(ovirt): fixes #126
Browse files Browse the repository at this point in the history
now that we have double index for vms, we have to create new index when new vm is added
  • Loading branch information
bl4ko committed May 3, 2024
1 parent 12e310d commit 6b5a477
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/netbox/inventory/add_items.go
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,9 @@ func (nbi *NetboxInventory) AddVM(ctx context.Context, newVM *objects.VM) (*obje
if err != nil {
return nil, err
}
if nbi.VMsIndexByNameAndClusterID[newVM.Name] == nil {
nbi.VMsIndexByNameAndClusterID[newVM.Name] = make(map[int]*objects.VM)
}
nbi.VMsIndexByNameAndClusterID[newVM.Name][newVMClusterID] = newVM
return newVM, nil
}
Expand Down

0 comments on commit 6b5a477

Please sign in to comment.