Skip to content

Commit

Permalink
Merge pull request #2279 from katiewasnothere/user/kabaldau/fix_parse…
Browse files Browse the repository at this point in the history
…_devices

Fix parse pod devices to not include invalid devices
  • Loading branch information
katiewasnothere authored Oct 14, 2024
2 parents e78ef44 + ffe8282 commit 677a76a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/oci/uvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,12 @@ func parseDevices(ctx context.Context, specWindows *specs.Windows) []uvm.VPCIDev
if specWindows == nil || specWindows.Devices == nil {
return nil
}
extraDevices := make([]uvm.VPCIDeviceID, len(specWindows.Devices))
for i, d := range specWindows.Devices {
extraDevices := []uvm.VPCIDeviceID{}
for _, d := range specWindows.Devices {
pciID, index := devices.GetDeviceInfoFromPath(d.ID)
if uvm.IsValidDeviceType(d.IDType) {
key := uvm.NewVPCIDeviceID(pciID, index)
extraDevices[i] = key
extraDevices = append(extraDevices, key)
} else {
log.G(ctx).WithFields(logrus.Fields{
"device": d,
Expand Down

0 comments on commit 677a76a

Please sign in to comment.