Merge pull request #84648 from neolit123/1.17-fix-reset-hang

kubeadm: always use a short timeout for clientset creation
This commit is contained in:
Kubernetes Prow Robot 2019-11-10 04:25:39 -08:00 committed by GitHub
commit 2f3376e463
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,7 +80,8 @@ func ClientSetFromFile(path string) (*clientset.Clientset, error) {
// ToClientSet converts a KubeConfig object to a client
func ToClientSet(config *clientcmdapi.Config) (*clientset.Clientset, error) {
clientConfig, err := clientcmd.NewDefaultClientConfig(*config, &clientcmd.ConfigOverrides{}).ClientConfig()
overrides := clientcmd.ConfigOverrides{Timeout: "10s"}
clientConfig, err := clientcmd.NewDefaultClientConfig(*config, &overrides).ClientConfig()
if err != nil {
return nil, errors.Wrap(err, "failed to create API client configuration from kubeconfig")
}