mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
Fix some lint errors
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
This commit is contained in:
parent
a36330d810
commit
fa6d027b24
@ -589,7 +589,7 @@ func createBypathTestFiles(t *testing.T, card, root, linkFile string, bypathFile
|
|||||||
t.Fatal("Couldn't create test drm dir", err)
|
t.Fatal("Couldn't create test drm dir", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := os.WriteFile(devPath, []byte{0}, os.ModePerm); err != nil {
|
if err := os.WriteFile(devPath, []byte{0}, 0o600); err != nil {
|
||||||
t.Fatal("Couldn't create card file", err)
|
t.Fatal("Couldn't create card file", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -604,7 +604,7 @@ func createBypathTestFiles(t *testing.T, card, root, linkFile string, bypathFile
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, f := range bypathFiles {
|
for _, f := range bypathFiles {
|
||||||
if err := os.WriteFile(path.Join(byPath, f), []byte{1}, os.ModePerm); err != nil {
|
if err := os.WriteFile(path.Join(byPath, f), []byte{1}, 0o600); err != nil {
|
||||||
t.Fatal("WriteFile failed:", path.Join(byPath, f))
|
t.Fatal("WriteFile failed:", path.Join(byPath, f))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,10 @@ func getFakeDevNodes(devDir, charDevDir, wqName string) ([]pluginapi.DeviceSpec,
|
|||||||
|
|
||||||
var devNum, queueNum int
|
var devNum, queueNum int
|
||||||
|
|
||||||
fmt.Sscanf(wqName, "wq%d.%d", &devNum, &queueNum)
|
if _, err := fmt.Sscanf(wqName, "wq%d.%d", &devNum, &queueNum); err != nil {
|
||||||
|
return []pluginapi.DeviceSpec{}, err
|
||||||
|
}
|
||||||
|
|
||||||
charDevPath := path.Join(charDevDir, fmt.Sprintf("%d:%d", dsaMajor, devNum*10+queueNum))
|
charDevPath := path.Join(charDevDir, fmt.Sprintf("%d:%d", dsaMajor, devNum*10+queueNum))
|
||||||
|
|
||||||
return []pluginapi.DeviceSpec{
|
return []pluginapi.DeviceSpec{
|
||||||
|
Loading…
Reference in New Issue
Block a user