mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-05-06 01:07:07 +00:00
Update dependencies to K8s 1.35
This commit is contained in:
2
vendor/github.com/tklauser/numcpus/.cirrus.yml
generated
vendored
2
vendor/github.com/tklauser/numcpus/.cirrus.yml
generated
vendored
@@ -1,6 +1,6 @@
|
||||
env:
|
||||
CIRRUS_CLONE_DEPTH: 1
|
||||
GO_VERSION: go1.24.0
|
||||
GO_VERSION: go1.25.0
|
||||
|
||||
freebsd_13_task:
|
||||
freebsd_instance:
|
||||
|
||||
10
vendor/github.com/tklauser/numcpus/numcpus_linux.go
generated
vendored
10
vendor/github.com/tklauser/numcpus/numcpus_linux.go
generated
vendored
@@ -47,10 +47,12 @@ func readCPURangeWith[T any](file string, f func(cpus string) (T, error)) (T, er
|
||||
if err != nil {
|
||||
return zero, err
|
||||
}
|
||||
return f(strings.Trim(string(buf), "\n "))
|
||||
return f(string(buf))
|
||||
}
|
||||
|
||||
func countCPURange(cpus string) (int, error) {
|
||||
cpus = strings.Trim(cpus, "\n ")
|
||||
|
||||
// Treat empty file as valid. This might be the case if there are no offline CPUs in which
|
||||
// case /sys/devices/system/cpu/offline is empty.
|
||||
if cpus == "" {
|
||||
@@ -58,7 +60,7 @@ func countCPURange(cpus string) (int, error) {
|
||||
}
|
||||
|
||||
n := int(0)
|
||||
for _, cpuRange := range strings.Split(cpus, ",") {
|
||||
for cpuRange := range strings.SplitSeq(cpus, ",") {
|
||||
if cpuRange == "" {
|
||||
return 0, fmt.Errorf("empty CPU range in CPU string %q", cpus)
|
||||
}
|
||||
@@ -84,13 +86,15 @@ func countCPURange(cpus string) (int, error) {
|
||||
}
|
||||
|
||||
func listCPURange(cpus string) ([]int, error) {
|
||||
cpus = strings.Trim(cpus, "\n ")
|
||||
|
||||
// See comment in countCPURange.
|
||||
if cpus == "" {
|
||||
return []int{}, nil
|
||||
}
|
||||
|
||||
list := []int{}
|
||||
for _, cpuRange := range strings.Split(cpus, ",") {
|
||||
for cpuRange := range strings.SplitSeq(cpus, ",") {
|
||||
if cpuRange == "" {
|
||||
return nil, fmt.Errorf("empty CPU range in CPU string %q", cpus)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user