mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
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:
commit
2f3376e463
@ -80,7 +80,8 @@ func ClientSetFromFile(path string) (*clientset.Clientset, error) {
|
|||||||
|
|
||||||
// ToClientSet converts a KubeConfig object to a client
|
// ToClientSet converts a KubeConfig object to a client
|
||||||
func ToClientSet(config *clientcmdapi.Config) (*clientset.Clientset, error) {
|
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 {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to create API client configuration from kubeconfig")
|
return nil, errors.Wrap(err, "failed to create API client configuration from kubeconfig")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user