From 1b9640496e846dc976339bd3f8ad2271c76e749c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 10 May 2020 12:31:58 +0200 Subject: [PATCH] ConfigureHosts: 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 --- remotes/docker/config/hosts.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/remotes/docker/config/hosts.go b/remotes/docker/config/hosts.go index 8268e2267..ae984219d 100644 --- a/remotes/docker/config/hosts.go +++ b/remotes/docker/config/hosts.go @@ -108,9 +108,9 @@ func ConfigureHosts(ctx context.Context, options HostOptions) docker.RegistryHos defaultTransport := &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,