use build-in max and min func to instead of k8s.io/utils/integer funcs

This commit is contained in:
weilaaa
2023-12-15 15:09:11 +08:00
parent 17823e00d1
commit eb8f3f194f
15 changed files with 19 additions and 71 deletions

View File

@@ -60,7 +60,6 @@ import (
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
"k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/controller/replicaset/metrics"
"k8s.io/utils/integer"
)
const (
@@ -768,7 +767,7 @@ func (rsc *ReplicaSetController) claimPods(ctx context.Context, rs *apps.Replica
func slowStartBatch(count int, initialBatchSize int, fn func() error) (int, error) {
remaining := count
successes := 0
for batchSize := integer.IntMin(remaining, initialBatchSize); batchSize > 0; batchSize = integer.IntMin(2*batchSize, remaining) {
for batchSize := min(remaining, initialBatchSize); batchSize > 0; batchSize = min(2*batchSize, remaining) {
errCh := make(chan error, batchSize)
var wg sync.WaitGroup
wg.Add(batchSize)