cpuset: Make 'ToSlice*' methods look like 'set' methods

In 'set', conversions to slice are done also, but with different names:

ToSliceNoSort() -> UnsortedList()
ToSlice() -> List()

Reimplement List() in terms of UnsortedList to save some duplication.
This commit is contained in:
Ian K. Coolidge
2022-11-08 15:09:09 +00:00
parent a0c989b99a
commit e5143d16c2
8 changed files with 40 additions and 43 deletions

View File

@@ -86,7 +86,7 @@ func getCPUsPerNUMANode(nodeNum int) ([]int, error) {
if err != nil {
return nil, err
}
return cpus.ToSlice(), nil
return cpus.List(), nil
}
func getCPUToNUMANodeMapFromEnv(f *framework.Framework, pod *v1.Pod, cnt *v1.Container, environ map[string]string, numaNodes int) (map[int]int, error) {
@@ -99,7 +99,7 @@ func getCPUToNUMANodeMapFromEnv(f *framework.Framework, pod *v1.Pod, cnt *v1.Con
if err != nil {
return nil, err
}
cpuIDs = cpus.ToSlice()
cpuIDs = cpus.List()
}
}
if len(cpuIDs) == 0 {
@@ -115,7 +115,7 @@ func getCPUToNUMANodeMapFromEnv(f *framework.Framework, pod *v1.Pod, cnt *v1.Con
if err != nil {
return nil, err
}
cpusPerNUMA[numaNode] = cpus.ToSlice()
cpusPerNUMA[numaNode] = cpus.List()
}
// CPU IDs -> NUMA Node ID