Skip to content

Commit a65301f

Browse files
committed
Add support for proxy via environment variables. Not completely sure this works because I don't have a real test environment, but this is what other providers have done. Closes #48
1 parent cda69f4 commit a65301f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

provider.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package main
55
import (
66
"errors"
77
"fmt"
8+
"net/http"
89

910
"github.com/MustWin/baremetal-sdk-go"
1011
"github.com/oracle/terraform-provider-baremetal/core"
@@ -186,6 +187,9 @@ func providerConfig(d *schema.ResourceData) (client interface{}, err error) {
186187
func(o *baremetal.NewClientOptions) {
187188
o.UserAgent = fmt.Sprintf("baremetal-terraform-v%s", baremetal.SDKVersion)
188189
},
190+
func(o *baremetal.NewClientOptions) {
191+
o.Transport = &http.Transport{Proxy: http.ProxyFromEnvironment}
192+
},
189193
}
190194

191195
if hasKey && privateKeyBuffer != "" {

0 commit comments

Comments
 (0)