Merge pull request #64 from dougbtv/downstream-45-api-timeout

Bug 1826084: [backport 4.5] Sets the Kubernetes API calls timeout to 60 seconds
This commit is contained in:
OpenShift Merge Robot 2020-05-11 17:56:48 +02:00 committed by GitHub
commit 96aa1de042
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,7 @@ import (
"os"
"regexp"
"strings"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -402,6 +403,8 @@ func GetK8sClient(kubeconfig string, kubeClient *ClientInfo) (*ClientInfo, error
// Specify that we use gRPC
config.AcceptContentTypes = "application/vnd.kubernetes.protobuf,application/json"
config.ContentType = "application/vnd.kubernetes.protobuf"
// Set the config timeout to one minute.
config.Timeout = time.Minute
// creates the clientset
client, err := kubernetes.NewForConfig(config)