mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #31346 from wojtek-t/dont_set_timeout_in_tests
Automatic merge from submit-queue Don't set timeouts in clients in tests We are not setting timeouts in production - we shouldn't do it in tests then... Addresses point 2. of #31345
This commit is contained in:
commit
5d3321ef83
@ -109,11 +109,6 @@ func invalidAuthFederationClientSet(user *framework.KubeUser) (*federation_relea
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating federation clientset: %v", err)
|
||||
}
|
||||
// Set timeout for each client in the set.
|
||||
c.DiscoveryClient.Client.Timeout = framework.SingleCallTimeout
|
||||
c.FederationClient.Client.Timeout = framework.SingleCallTimeout
|
||||
c.CoreClient.Client.Timeout = framework.SingleCallTimeout
|
||||
c.ExtensionsClient.Client.Timeout = framework.SingleCallTimeout
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
@ -1945,20 +1945,9 @@ func loadClientFromConfig(config *restclient.Config) (*client.Client, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating client: %v", err.Error())
|
||||
}
|
||||
if c.Client.Timeout == 0 {
|
||||
c.Client.Timeout = SingleCallTimeout
|
||||
}
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func setTimeouts(cs ...*http.Client) {
|
||||
for _, client := range cs {
|
||||
if client.Timeout == 0 {
|
||||
client.Timeout = SingleCallTimeout
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func LoadFederationClientset_1_5() (*federation_release_1_5.Clientset, error) {
|
||||
config, err := LoadFederatedConfig(&clientcmd.ConfigOverrides{})
|
||||
if err != nil {
|
||||
@ -1969,8 +1958,6 @@ func LoadFederationClientset_1_5() (*federation_release_1_5.Clientset, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating federation clientset: %v", err.Error())
|
||||
}
|
||||
// Set timeout for each client in the set.
|
||||
setTimeouts(c.DiscoveryClient.Client, c.FederationClient.Client, c.CoreClient.Client, c.ExtensionsClient.Client)
|
||||
return c, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user