From c96373f6d55d4aedc3d7fc97a29dae7f74b32381 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 10 May 2020 12:39:10 +0200 Subject: [PATCH] newTransport(): remove deprecated DualStack option The `DualStack` option was deprecated in Go 1.12, and is now enabled by default (through commit github.com/golang/go@efc185029bf770894defe63cec2c72a4c84b2ee9). > The Dialer.DualStack field is now meaningless and documented as deprecated. > > To disable fallback, set FallbackDelay to a negative value. The default `FallbackDelay` is 300ms; to make this more explicit, this patch sets `FallbackDelay` to the default value. Note that Docker Hub currently does not support IPv6 (DNS for registry-1.docker.io has no AAAA records, so we should not hit the 300ms delay). Signed-off-by: Sebastiaan van Stijn --- pkg/server/image_pull.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/server/image_pull.go b/pkg/server/image_pull.go index 5c6d6b880..b8ba36bc3 100644 --- a/pkg/server/image_pull.go +++ b/pkg/server/image_pull.go @@ -425,9 +425,9 @@ func newTransport() *http.Transport { return &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + FallbackDelay: 300 * time.Millisecond, }).DialContext, MaxIdleConns: 10, IdleConnTimeout: 30 * time.Second,