Skip to content

Commit 1e20db6

Browse files
authored
Merge pull request #53 from CheerChen/master
fix: Matching error in getDeviceName
2 parents 201a1da + 10559b8 commit 1e20db6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/device_plugin/device_plugin.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ func getDeviceName(deviceID string) string {
314314
log.Printf("Error processing pci.ids file at line: %s", line)
315315
return deviceName
316316
}
317+
// fix matching
318+
if splits[0] != "" {
319+
continue
320+
}
317321
deviceName = strings.TrimSpace(splits[1])
318322
deviceName = strings.ToUpper(deviceName)
319323
deviceName = strings.Replace(deviceName, "/", "_", -1)

0 commit comments

Comments
 (0)