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

Commit

Permalink
Don't configure proxy from env twice
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pascal-hofmann authored Nov 26, 2019
1 parent 74708bb commit b8650a4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions mysql/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ func Provider() terraform.ResourceProvider {
"proxy": {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"ALL_PROXY",
"all_proxy",
}, nil),
Default: nil,
ValidateFunc: validation.StringMatch(regexp.MustCompile("^socks5h?://.*:\\d+$"), "The proxy URL is not a valid socks url."),
},

Expand Down

0 comments on commit b8650a4

Please sign in to comment.