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 <efoster@adobe.com>
(cherry picked from commit 69362df367)
release-3.15 v3.15.3
Evan Foster 7 months ago committed by Matt Farina
parent f440d3b19e
commit 3bb50bbbdd
No known key found for this signature in database
GPG Key ID: 92C44A3D421FF7F9

@ -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
}

Loading…
Cancel
Save