From b4071e3f0a1c12e6c1365f0fdcb75a5ed1660720 Mon Sep 17 00:00:00 2001 From: neargle Date: Sat, 6 Apr 2024 15:00:48 +0800 Subject: [PATCH] fix(eva): long standing timeout in discovery k8s apiserver with sa, error msg: GET, ...connection timed out --- pkg/tool/kubectl/common.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/tool/kubectl/common.go b/pkg/tool/kubectl/common.go index 3940a4f..bcaa132 100644 --- a/pkg/tool/kubectl/common.go +++ b/pkg/tool/kubectl/common.go @@ -26,6 +26,7 @@ import ( "os" "regexp" "strings" + "time" "github.com/cdk-team/CDK/conf" "github.com/cdk-team/CDK/pkg/errors" @@ -139,6 +140,7 @@ func ServerAccountRequest(opts K8sRequestOption) (string, error) { Transport: &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, }, + Timeout: time.Second * 3, } var request *http.Request opts.Method = strings.ToUpper(opts.Method)