Use dual-stack Dialer when talking to registy
Signed-off-by: Gleb M. Borisov <borisov.gleb@gmail.com>
This commit is contained in:
parent
3a6fe4c5c9
commit
ef57ab120c
1 changed files with 6 additions and 2 deletions
|
@ -56,7 +56,9 @@ func newClient(jar http.CookieJar, roots *x509.CertPool, cert *tls.Certificate,
|
||||||
case ConnectTimeout:
|
case ConnectTimeout:
|
||||||
httpTransport.Dial = func(proto string, addr string) (net.Conn, error) {
|
httpTransport.Dial = func(proto string, addr string) (net.Conn, error) {
|
||||||
// Set the connect timeout to 5 seconds
|
// Set the connect timeout to 5 seconds
|
||||||
conn, err := net.DialTimeout(proto, addr, 5*time.Second)
|
d := net.Dialer{Timeout: 5 * time.Second, DualStack: true}
|
||||||
|
|
||||||
|
conn, err := d.Dial(proto, addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -66,7 +68,9 @@ func newClient(jar http.CookieJar, roots *x509.CertPool, cert *tls.Certificate,
|
||||||
}
|
}
|
||||||
case ReceiveTimeout:
|
case ReceiveTimeout:
|
||||||
httpTransport.Dial = func(proto string, addr string) (net.Conn, error) {
|
httpTransport.Dial = func(proto string, addr string) (net.Conn, error) {
|
||||||
conn, err := net.Dial(proto, addr)
|
d := net.Dialer{DualStack: true}
|
||||||
|
|
||||||
|
conn, err := d.Dial(proto, addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue