Skip to content

Commit dbfa243

Browse files
committed
Now fix should be working properly
removed redundant code bug fix
1 parent 3b56199 commit dbfa243

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

cmd/gpu_fakedev/gpu_fakedev.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -374,19 +374,8 @@ func saveSideCarFile(connections string) {
374374
}
375375
defer f.Close()
376376

377-
if len(connections) <= maxK8sLabelSize {
378-
line := fmt.Sprintf("xpumanager.intel.com/xe-links=%s", connections)
379-
fmt.Println(line)
380-
381-
if _, err := f.WriteString(line + "\n"); err != nil {
382-
panic(err)
383-
}
384-
385-
return
386-
}
387-
388377
// Write first line without Z prefix
389-
line := fmt.Sprintf("xpumanager.intel.com/xe-links=%s", connections[:maxK8sLabelSize])
378+
line := fmt.Sprintf("xpumanager.intel.com/xe-links=%s", connections[:min(len(connections), maxK8sLabelSize)])
390379
fmt.Println(line)
391380

392381
if _, err := f.WriteString(line + "\n"); err != nil {

0 commit comments

Comments
 (0)