From 69362df367d6a4a620fde0d7833a805436e23506 Mon Sep 17 00:00:00 2001 From: Evan Foster Date: Tue, 18 Jun 2024 13:08:21 -0600 Subject: [PATCH] fix(helm): Use burst limit setting for discovery When --burst-limit/$HELM_BURST_LIMIT is set, the specified value is not currently used for the discovery client instantiated by genericclioptions. This change sets genericclioptions.discoveryBurst to the value of --burst-limit, meaning it should now be possible to fix client-side throttling issues encountered by the discovery client. This value is only configured if --burst-limit is actually set. If --burst-limit is set to the default value, then discoveryBurst should be left at its default of 300. Closes #13128 Signed-off-by: Evan Foster --- pkg/cli/environment.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/cli/environment.go b/pkg/cli/environment.go index ba103252d..438ba1515 100644 --- a/pkg/cli/environment.go +++ b/pkg/cli/environment.go @@ -112,7 +112,7 @@ func New() *EnvSettings { env.Debug, _ = strconv.ParseBool(os.Getenv("HELM_DEBUG")) // bind to kubernetes config flags - env.config = &genericclioptions.ConfigFlags{ + config := &genericclioptions.ConfigFlags{ Namespace: &env.namespace, Context: &env.KubeContext, BearerToken: &env.KubeToken, @@ -133,6 +133,11 @@ func New() *EnvSettings { return config }, } + if env.BurstLimit != defaultBurstLimit { + config = config.WithDiscoveryBurst(env.BurstLimit) + } + env.config = config + return env }