Skip to content
This repository was archived by the owner on Jan 12, 2021. It is now read-only.

Commit 66adad4

Browse files
Don't configure proxy from env twice
The proxy env vars are already taken into consideration here https://github.com/terraform-providers/terraform-provider-mysql/blob/master/mysql/provider.go#L152 Setting them as default for `proxy` leads to the proxy being set as proxy itself and as forwarder (see https://github.com/terraform-providers/terraform-provider-mysql/blob/master/mysql/provider.go#L160). This leads to the following error (with `all_proxy=socks5://127.0.0.1:1080`) Could not connect to server: socks connect tcp localhost:1080->target_host:target_port: socks connect tcp localhost: 1080->localhost: 1080
1 parent 74708bb commit 66adad4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

mysql/provider.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,9 @@ func Provider() terraform.ResourceProvider {
6161
},
6262

6363
"proxy": {
64-
Type: schema.TypeString,
65-
Optional: true,
66-
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
67-
"ALL_PROXY",
68-
"all_proxy",
69-
}, nil),
64+
Type: schema.TypeString,
65+
Optional: true,
66+
Default: nil,
7067
ValidateFunc: validation.StringMatch(regexp.MustCompile("^socks5h?://.*:\\d+$"), "The proxy URL is not a valid socks url."),
7168
},
7269

0 commit comments

Comments
 (0)