mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-08-17 15:52:37 +00:00
Sets the Kubernetes API calls timeout to 60 seconds
This commit is contained in:
parent
931c12531d
commit
92beb4bcdc
@ -21,6 +21,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/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
|
// Specify that we use gRPC
|
||||||
config.AcceptContentTypes = "application/vnd.kubernetes.protobuf,application/json"
|
config.AcceptContentTypes = "application/vnd.kubernetes.protobuf,application/json"
|
||||||
config.ContentType = "application/vnd.kubernetes.protobuf"
|
config.ContentType = "application/vnd.kubernetes.protobuf"
|
||||||
|
// Set the config timeout to one minute.
|
||||||
|
config.Timeout = time.Minute
|
||||||
|
|
||||||
// creates the clientset
|
// creates the clientset
|
||||||
client, err := kubernetes.NewForConfig(config)
|
client, err := kubernetes.NewForConfig(config)
|
||||||
|
Loading…
Reference in New Issue
Block a user