From be203340be19be5eee5ee2508adcfaf38c1dbed7 Mon Sep 17 00:00:00 2001 From: Manu Gupta Date: Fri, 18 Feb 2022 10:24:44 -0800 Subject: [PATCH] Remove deprecated GOPROXY in favor of GoBinaryEnvVars (#1759) --- charts/athens-proxy/Chart.yaml | 4 ++-- cmd/proxy/actions/app_proxy.go | 4 ---- config.dev.toml | 8 -------- pkg/config/config.go | 2 -- pkg/config/config_test.go | 3 --- 5 files changed, 2 insertions(+), 19 deletions(-) diff --git a/charts/athens-proxy/Chart.yaml b/charts/athens-proxy/Chart.yaml index 7df2e024..a96a8cfd 100644 --- a/charts/athens-proxy/Chart.yaml +++ b/charts/athens-proxy/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: athens-proxy -version: 0.5.0 -appVersion: 0.11.0 +version: 0.5.1 +appVersion: 0.11.1 description: The proxy server for Go modules icon: https://raw.githubusercontent.com/gomods/athens/main/docs/static/banner.png keywords: diff --git a/cmd/proxy/actions/app_proxy.go b/cmd/proxy/actions/app_proxy.go index 4775be50..5e39fe1b 100644 --- a/cmd/proxy/actions/app_proxy.go +++ b/cmd/proxy/actions/app_proxy.go @@ -86,10 +86,6 @@ func addProxyRoutes( // 4. The plain stash.New just takes a request from upstream and saves it into storage. fs := afero.NewOsFs() - // TODO: remove before we release v0.7.0 - if c.GoProxy != "direct" && c.GoProxy != "" { - l.Error("GoProxy is deprecated, please use GoBinaryEnvVars") - } if !c.GoBinaryEnvVars.HasKey("GONOSUMDB") { c.GoBinaryEnvVars.Add("GONOSUMDB", strings.Join(c.NoSumPatterns, ",")) } diff --git a/config.dev.toml b/config.dev.toml index 31a48aad..093d1a3e 100755 --- a/config.dev.toml +++ b/config.dev.toml @@ -15,14 +15,6 @@ GoBinary = "go" # Env override: GO_ENV GoEnv = "development" -# GoProxy IS DEPRECATED and will be removed in v0.7.0: PLEASE USE GoBinaryEnvVars -# GoProxy specifies GOPROXY env for go list or mod download inside athens -# which can be configured totally same with GOPROXY of Go Command. -# Notes that the comma-separated GOPROXY (e.g. ,,direct) is only available in Go 1.13 or higher, -# otherwise only single proxy URL can be set. -# Env override: GOPROXY -GoProxy = "direct" - # GoBinaryEnvVars are environment variables that you'd like # to pass directly to the Go command that Athens runs under the # hood. Athens primarily runs two Go commands: diff --git a/pkg/config/config.go b/pkg/config/config.go index 746a8143..1bd9fa08 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -23,7 +23,6 @@ type Config struct { TimeoutConf GoEnv string `validate:"required" envconfig:"GO_ENV"` GoBinary string `validate:"required" envconfig:"GO_BINARY_PATH"` - GoProxy string `envconfig:"GOPROXY"` GoBinaryEnvVars EnvList `envconfig:"ATHENS_GO_BINARY_ENV_VARS"` GoGetWorkers int `validate:"required" envconfig:"ATHENS_GOGET_WORKERS"` GoGetDir string `envconfig:"ATHENS_GOGET_DIR"` @@ -146,7 +145,6 @@ func defaultConfig() *Config { GoBinary: "go", GoBinaryEnvVars: EnvList{"GOPROXY=direct"}, GoEnv: "development", - GoProxy: "direct", GoGetWorkers: 10, ProtocolWorkers: 30, LogLevel: "debug", diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 2faac289..6e082b49 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -76,7 +76,6 @@ func TestEnvOverrides(t *testing.T) { ProtocolWorkers: 10, LogLevel: "info", GoBinary: "go11", - GoProxy: "direct", CloudRuntime: "gcp", TimeoutConf: TimeoutConf{ Timeout: 30, @@ -268,7 +267,6 @@ func TestParseExampleConfig(t *testing.T) { GoEnv: "development", LogLevel: "debug", GoBinary: "go", - GoProxy: "direct", GoGetWorkers: 10, ProtocolWorkers: 30, CloudRuntime: "none", @@ -316,7 +314,6 @@ func getEnvMap(config *Config) map[string]string { envVars := map[string]string{ "GO_ENV": config.GoEnv, "GO_BINARY_PATH": config.GoBinary, - "GOPROXY": config.GoProxy, "ATHENS_GOGET_WORKERS": strconv.Itoa(config.GoGetWorkers), "ATHENS_PROTOCOL_WORKERS": strconv.Itoa(config.ProtocolWorkers), "ATHENS_LOG_LEVEL": config.LogLevel,