Skip to content

Commit 870ce5a

Browse files
authored
Merge pull request #3087 from wojtek-t/bump_golang
Bump golang in perf-test to 1.23.4
2 parents 3be6af7 + 2a33258 commit 870ce5a

File tree

21 files changed

+41
-41
lines changed

21 files changed

+41
-41
lines changed

benchmark/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module k8s.io/perf-tests/benchmark
22

3-
go 1.22.4
3+
go 1.23.4
44

55
require (
66
github.com/dgryski/go-onlinestats v0.0.0-20170612111826-1c7d19468768

benchmark/pkg/util/util.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,20 +188,20 @@ func GetFlattennedComparisonData(leftJobMetrics, rightJobMetrics []map[string][]
188188
return j
189189
}
190190

191-
func computeSampleStats(sample []float64, avg, stDev, max *float64) {
191+
func computeSampleStats(sample []float64, avg, stDev, maxVal *float64) {
192192
length := len(sample)
193193
if length == 0 {
194194
*avg = math.NaN()
195195
*stDev = math.NaN()
196-
*max = math.NaN()
196+
*maxVal = math.NaN()
197197
return
198198
}
199199
sum := 0.0
200200
squareSum := 0.0
201201
for i := 0; i < length; i++ {
202202
sum += sample[i]
203203
squareSum += sample[i] * sample[i]
204-
*max = math.Max(*max, sample[i])
204+
*maxVal = math.Max(*maxVal, sample[i])
205205
}
206206
*avg = sum / float64(length)
207207
*stDev = math.Sqrt(squareSum/float64(length) - (*avg * *avg))

clusterloader2/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module k8s.io/perf-tests/clusterloader2
22

33
// go 1.15+ is required by k8s 1.20 we use as dependency.
4-
go 1.22.4
4+
go 1.23.4
55

66
replace (
77
k8s.io/api => k8s.io/api v0.29.7

clusterloader2/pkg/config/template_functions.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,22 +193,22 @@ func maxFloat(numbers ...interface{}) float64 {
193193
if len(numbers) == 0 {
194194
panic("maximum undefined")
195195
}
196-
max := toFloat64(numbers[0])
196+
result := toFloat64(numbers[0])
197197
for _, number := range numbers {
198-
max = math.Max(max, toFloat64(number))
198+
result = math.Max(result, toFloat64(number))
199199
}
200-
return max
200+
return result
201201
}
202202

203203
func minFloat(numbers ...interface{}) float64 {
204204
if len(numbers) == 0 {
205205
panic("minimum undefined")
206206
}
207-
min := toFloat64(numbers[0])
207+
result := toFloat64(numbers[0])
208208
for _, number := range numbers {
209-
min = math.Min(min, toFloat64(number))
209+
result = math.Min(result, toFloat64(number))
210210
}
211-
return min
211+
return result
212212
}
213213

214214
func mod(a interface{}, b interface{}) int {

clusterloader2/pkg/imagepreload/imagepreload.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (c *controller) PreloadImages() error {
112112
return kclient.CoreV1().Nodes().Watch(context.TODO(), options)
113113
},
114114
},
115-
func(old, new interface{}) { c.checkNode(doneNodes, old, new) })
115+
func(oldObj, newObj interface{}) { c.checkNode(doneNodes, oldObj, newObj) })
116116
if err := informer.StartAndSync(nodeInformer, stopCh, informerTimeout); err != nil {
117117
return err
118118
}
@@ -164,15 +164,15 @@ func (c *controller) PreloadImages() error {
164164
return nil
165165
}
166166

167-
func (c *controller) checkNode(set map[string]struct{}, old, new interface{}) {
168-
if new != nil {
169-
node := new.(*v1.Node)
167+
func (c *controller) checkNode(set map[string]struct{}, oldObj, newObj interface{}) {
168+
if newObj != nil {
169+
node := newObj.(*v1.Node)
170170
preloaded := c.hasPreloadedImages(node)
171171
c.markDone(set, node.Name, preloaded)
172172
return
173173
}
174-
if old != nil {
175-
node := old.(*v1.Node)
174+
if oldObj != nil {
175+
node := oldObj.(*v1.Node)
176176
c.markDone(set, node.Name, false)
177177
return
178178
}

clusterloader2/pkg/measurement/common/loadbalancer_nodesync_latency.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,13 @@ func isCandidateNode(node v1.Node) bool {
293293
return true
294294
}
295295

296-
func preparePatchBytes(old, new, refStruct interface{}) ([]byte, error) {
297-
oldBytes, err := json.Marshal(old)
296+
func preparePatchBytes(oldObj, newObj, refStruct interface{}) ([]byte, error) {
297+
oldBytes, err := json.Marshal(oldObj)
298298
if err != nil {
299299
return nil, fmt.Errorf("failed to marshal old object: %v", err)
300300
}
301301

302-
newBytes, err := json.Marshal(new)
302+
newBytes, err := json.Marshal(newObj)
303303
if err != nil {
304304
return nil, fmt.Errorf("failed to marshal new object: %v", err)
305305
}

clusterloader2/pkg/measurement/common/network/network_performance_measurement.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func (npm *networkPerformanceMeasurement) gather() (measurement.Summary, error)
285285
if err != nil {
286286
klog.Infof("Failed to print metrics: %v", err)
287287
}
288-
summaryName := fmt.Sprintf(npm.String() + "_" + resultSummary.podRatio + "_" + resultSummary.protocol + "_" + resultSummary.service)
288+
summaryName := fmt.Sprint(npm.String() + "_" + resultSummary.podRatio + "_" + resultSummary.protocol + "_" + resultSummary.service)
289289
return measurement.CreateSummary(summaryName, "json", content), nil
290290
}
291291

clusterloader2/pkg/measurement/common/wait_for_controlled_pods.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ func (w *waitForControlledPodsRunningMeasurement) updateCacheLocked(oldObj, newO
514514
if errList.IsEmpty() {
515515
return nil
516516
}
517-
return fmt.Errorf(errList.Error())
517+
return errList
518518
}
519519

520520
func (w *waitForControlledPodsRunningMeasurement) updateOpResourceVersionLocked(runtimeObj runtime.Object) error {

clusterloader2/pkg/measurement/common/wait_for_generic_k8s_object.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,18 @@ func getNamespaces(namespacesPrefix string, params map[string]interface{}) (meas
135135
if err != nil {
136136
return measurementutil.NamespacesRange{}, err
137137
}
138-
min, err := util.GetInt(namespaceRange, "min")
138+
minParam, err := util.GetInt(namespaceRange, "min")
139139
if err != nil {
140140
return measurementutil.NamespacesRange{}, err
141141
}
142-
max, err := util.GetInt(namespaceRange, "max")
142+
maxParam, err := util.GetInt(namespaceRange, "max")
143143
if err != nil {
144144
return measurementutil.NamespacesRange{}, err
145145
}
146146

147147
return measurementutil.NamespacesRange{
148148
Prefix: namespacesPrefix,
149-
Min: min,
150-
Max: max,
149+
Min: minParam,
150+
Max: maxParam,
151151
}, nil
152152
}

dns/dnsperfgo/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module k8s.io/perf-tests/dns/dnsperfgo
22

3-
go 1.22.4
3+
go 1.23.4
44

55
require (
66
github.com/prometheus/client_golang v1.20.5

0 commit comments

Comments
 (0)