From 51380e672bdb62f8b8b0fc7c84b4b97ce4faf420 Mon Sep 17 00:00:00 2001 From: Jaired Jawed Date: Thu, 20 Feb 2025 10:09:47 -0800 Subject: [PATCH] updated to burst to uint --- internal/options/env.go | 2 +- internal/options/env_test.go | 2 +- main.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/options/env.go b/internal/options/env.go index 8c6aadf9..3783e1f1 100644 --- a/internal/options/env.go +++ b/internal/options/env.go @@ -54,7 +54,7 @@ type VSOEnvOptions struct { KubeClientQPS float64 `split_words:"true"` // KubeClientBurst is the VSO_KUBE_CLIENT_BURST environment variable option - KubeClientBurst *int `split_words:"true"` + KubeClientBurst *uint `split_words:"true"` } // Parse environment variable options, prefixed with "VSO_" diff --git a/internal/options/env_test.go b/internal/options/env_test.go index 8cfdf3ca..264b3851 100644 --- a/internal/options/env_test.go +++ b/internal/options/env_test.go @@ -52,7 +52,7 @@ func TestParse(t *testing.T) { GlobalVaultAuthOptions: []string{"vOpt1", "vOpt2"}, ClientCacheNumLocks: ptr.To(10), KubeClientQPS: 100, - KubeClientBurst: ptr.To(1000), + KubeClientBurst: ptr.To(uint(1000)), }, }, } diff --git a/main.go b/main.go index 390923b8..58eb6194 100644 --- a/main.go +++ b/main.go @@ -148,7 +148,7 @@ func main() { var backoffMultiplier float64 var backoffMaxElapsedTime time.Duration var kubeClientQPS float64 - var kubeClientBurst int + var kubeClientBurst uint // command-line args and flags flag.BoolVar(&printVersion, "version", false, "Print the operator version information") @@ -222,7 +222,7 @@ func main() { "Maximum queries per second to limit requests sent to the API server and prevent overload. "+ "When the value is 0, the kubernetes client's default is used. "+ "Also set from environment variable VSO_KUBE_CLIENT_QPS.") - flag.IntVar(&kubeClientBurst, "kube-client-burst", 0, + flag.UintVar(&kubeClientBurst, "kube-client-burst", 0, "Maximum burst for throttling requests to the Kubernetes API. "+ "When the value is 0, the kubernetes client's default is used. "+ "Also set from environment variable VSO_KUBE_CLIENT_BURST.") @@ -363,7 +363,7 @@ func main() { config.QPS = float32(kubeClientQPS) } if kubeClientBurst != 0 { - config.Burst = kubeClientBurst + config.Burst = int(kubeClientBurst) } defaultClient, err := client.NewWithWatch(config, client.Options{