mirror of
https://github.com/rancher/rke.git
synced 2025-08-01 07:08:38 +00:00
Set timeout for WrapTransport
This commit is contained in:
parent
8b8bc8ab8b
commit
d72c0849b3
@ -11,8 +11,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DefaultRetries = 5
|
DefaultRetries = 5
|
||||||
DefaultSleepSeconds = 5
|
DefaultSleepSeconds = 5
|
||||||
|
K8sWrapTransportTimeout = 30
|
||||||
)
|
)
|
||||||
|
|
||||||
type k8sCall func(*kubernetes.Clientset, interface{}) error
|
type k8sCall func(*kubernetes.Clientset, interface{}) error
|
||||||
@ -28,6 +29,7 @@ func NewClient(kubeConfigPath string, k8sWrapTransport WrapTransport) (*kubernet
|
|||||||
if k8sWrapTransport != nil {
|
if k8sWrapTransport != nil {
|
||||||
config.WrapTransport = k8sWrapTransport
|
config.WrapTransport = k8sWrapTransport
|
||||||
}
|
}
|
||||||
|
config.Timeout = time.Second * time.Duration(K8sWrapTransportTimeout)
|
||||||
K8sClientSet, err := kubernetes.NewForConfig(config)
|
K8sClientSet, err := kubernetes.NewForConfig(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user