Update dependencies to K8s 1.35

This commit is contained in:
Ciprian Hacman
2025-12-23 08:53:36 +02:00
parent 1d11a6cd55
commit 9cfeb3197e
1506 changed files with 50741 additions and 70047 deletions

View File

@@ -1,6 +1,6 @@
env:
CIRRUS_CLONE_DEPTH: 1
GO_VERSION: go1.24.0
GO_VERSION: go1.25.0
freebsd_13_task:
freebsd_instance:

View File

@@ -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)
}