File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 55 "fmt"
66 "math"
77 "net/http"
8+ "net/url"
9+ "os"
810 "strings"
911 "sync"
1012 "time"
@@ -208,11 +210,20 @@ func (ep *RegistryEndpoint) DeepCopy() *RegistryEndpoint {
208210
209211// GetTransport returns a transport object for this endpoint
210212func (ep * RegistryEndpoint ) GetTransport () * http.Transport {
213+ transport := http.Transport {}
211214 tlsC := & tls.Config {}
215+
212216 if ep .Insecure {
213217 tlsC .InsecureSkipVerify = true
214218 }
215- return & http.Transport {TLSClientConfig : tlsC }
219+ transport .TLSClientConfig = tlsC
220+
221+ if proxy , ok := os .LookupEnv ("HTTP_PROXY" ); ok {
222+ proxyUrl , _ := url .Parse (proxy )
223+ transport .Proxy = http .ProxyURL (proxyUrl )
224+ }
225+
226+ return & transport
216227}
217228
218229func init () {
You can’t perform that action at this time.
0 commit comments