1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/pkg/config/client.go
Charles-Edouard Brétéché 4d08354498
fix: remove kubeconfig (#3802)
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>

Co-authored-by: Sambhav Kothari <sambhavs.email@gmail.com>
2022-05-05 10:12:43 +00:00

18 lines
439 B
Go

package config
import (
"fmt"
"math"
rest "k8s.io/client-go/rest"
)
// ConfigureClientConfig creates client config and applies rate limit QPS and burst
func ConfigureClientConfig(clientConfig *rest.Config, qps float64, burst int) error {
if qps > math.MaxFloat32 {
return fmt.Errorf("client rate limit QPS must not be higher than %e", math.MaxFloat32)
}
clientConfig.Burst = burst
clientConfig.QPS = float32(qps)
return nil
}