Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: kubeCmdFactory will lose WrapTransport config #620

Open
a244591052 opened this issue Aug 25, 2024 · 0 comments
Open

Bug: kubeCmdFactory will lose WrapTransport config #620

a244591052 opened this issue Aug 25, 2024 · 0 comments

Comments

@a244591052
Copy link

a244591052 commented Aug 25, 2024

func kubeCmdFactory(kubeconfig, ns string, config *rest.Config) cmdutil.Factory {
kubeConfigFlags := genericclioptions.NewConfigFlags(true)
if ns != "" {
kubeConfigFlags.Namespace = &ns
}
kubeConfigFlags.KubeConfig = &kubeconfig
kubeConfigFlags.WithDiscoveryBurst(config.Burst)
kubeConfigFlags.WithDiscoveryQPS(config.QPS)
matchVersionKubeConfigFlags := cmdutil.NewMatchVersionFlags(kubeConfigFlags)
return cmdutil.NewFactory(matchVersionKubeConfigFlags)
}

In the above code, WrapTransport is not passed, which will cause the client corresponding to the NewFactory to have no WrapTransport, which is not as expected.

In addition, RateLimiter is not passed, which will cause the NewFactory client to create a new RateLimiter using the passed in QPS. If k8s is limiting the flow for the client, then it is expected. If k8s is limiting the flow for the IP address, then RateLimiter should be passed.

fix pr: #622

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant