From 72bb0798ef6b560efcea0243593409bd5acd7c73 Mon Sep 17 00:00:00 2001 From: Daniel Higuero Date: Tue, 8 Aug 2023 03:43:41 +0200 Subject: [PATCH] Fix: test timeout due to hardcoded goproxy (#6246) Co-authored-by: JohnJan --- pkg/definition/gen_sdk/go.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/definition/gen_sdk/go.go b/pkg/definition/gen_sdk/go.go index 716c33199..5ff7e25e8 100644 --- a/pkg/definition/gen_sdk/go.go +++ b/pkg/definition/gen_sdk/go.go @@ -35,6 +35,9 @@ import ( pkgdef "github.com/oam-dev/kubevela/pkg/definition" ) +// GoProxyEnvKey with the environment variable name that defines the GOPROXY preferences. +const GoProxyEnvKey = "GOPROXY" + var ( mainModuleVersionKey langArgKey = "MainModuleVersion" goProxyKey langArgKey = "GoProxy" @@ -48,11 +51,13 @@ var ( goProxy = LangArg{ Name: goProxyKey, Desc: "The proxy for go get/go mod tidy command", - Default: "https://goproxy.cn,direct", + Default: "", } ) func init() { + // Propagate the environment GOPROXY variable to the tests that are executed through external containers. + goProxy.Default = os.Getenv(GoProxyEnvKey) registerLangArg("go", mainModuleVersion, goProxy) }