From d72c0849b37bf91b75ccea169ee06a5f98654afd Mon Sep 17 00:00:00 2001 From: moelsayed Date: Tue, 27 Mar 2018 20:38:14 +0200 Subject: [PATCH] Set timeout for WrapTransport --- k8s/k8s.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/k8s/k8s.go b/k8s/k8s.go index 97654e2a..29e4efcd 100644 --- a/k8s/k8s.go +++ b/k8s/k8s.go @@ -11,8 +11,9 @@ import ( ) const ( - DefaultRetries = 5 - DefaultSleepSeconds = 5 + DefaultRetries = 5 + DefaultSleepSeconds = 5 + K8sWrapTransportTimeout = 30 ) type k8sCall func(*kubernetes.Clientset, interface{}) error @@ -28,6 +29,7 @@ func NewClient(kubeConfigPath string, k8sWrapTransport WrapTransport) (*kubernet if k8sWrapTransport != nil { config.WrapTransport = k8sWrapTransport } + config.Timeout = time.Second * time.Duration(K8sWrapTransportTimeout) K8sClientSet, err := kubernetes.NewForConfig(config) if err != nil { return nil, err