mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #16821 from caesarxuchao/restclient-timeout
Auto commit by PR queue bot
This commit is contained in:
commit
d71a667aab
@ -19,7 +19,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
|
||||||
|
|
||||||
docker "github.com/fsouza/go-dockerclient"
|
docker "github.com/fsouza/go-dockerclient"
|
||||||
|
|
||||||
@ -72,9 +71,6 @@ func createClientFromFile(path string) (*client.Client, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error while creating client: %v", err)
|
return nil, fmt.Errorf("error while creating client: %v", err)
|
||||||
}
|
}
|
||||||
if client.Timeout == 0 {
|
|
||||||
client.Timeout = 30 * time.Second
|
|
||||||
}
|
|
||||||
return client, nil
|
return client, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ package unversioned
|
|||||||
import (
|
import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
@ -46,8 +45,6 @@ type RESTClient struct {
|
|||||||
// used.
|
// used.
|
||||||
Client HTTPClient
|
Client HTTPClient
|
||||||
|
|
||||||
Timeout time.Duration
|
|
||||||
|
|
||||||
// TODO extract this into a wrapper interface via the RESTClient interface in kubectl.
|
// TODO extract this into a wrapper interface via the RESTClient interface in kubectl.
|
||||||
Throttle util.RateLimiter
|
Throttle util.RateLimiter
|
||||||
}
|
}
|
||||||
@ -91,7 +88,7 @@ func (c *RESTClient) Verb(verb string) *Request {
|
|||||||
if c.Throttle != nil {
|
if c.Throttle != nil {
|
||||||
c.Throttle.Accept()
|
c.Throttle.Accept()
|
||||||
}
|
}
|
||||||
return NewRequest(c.Client, verb, c.baseURL, c.apiVersion, c.Codec).Timeout(c.Timeout)
|
return NewRequest(c.Client, verb, c.baseURL, c.apiVersion, c.Codec)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Post begins a POST request. Short for c.Verb("POST").
|
// Post begins a POST request. Short for c.Verb("POST").
|
||||||
|
@ -894,9 +894,6 @@ func loadClient() (*client.Client, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error creating client: %v", err.Error())
|
return nil, fmt.Errorf("error creating client: %v", err.Error())
|
||||||
}
|
}
|
||||||
if c.Timeout == 0 {
|
|
||||||
c.Timeout = singleCallTimeout
|
|
||||||
}
|
|
||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user