From 5e63ab619e2ed763bdfd147ad64f8f8ecedde911 Mon Sep 17 00:00:00 2001 From: Kevin Pollet Date: Fri, 25 Sep 2020 09:14:04 +0200 Subject: [PATCH] Fix default value of docker client timeout --- docs/content/providers/docker.md | 4 ++-- docs/content/reference/static-configuration/cli-ref.md | 2 +- docs/content/reference/static-configuration/env-ref.md | 2 +- pkg/config/static/static_config.go | 4 ++-- pkg/provider/docker/docker.go | 1 - 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/content/providers/docker.md b/docs/content/providers/docker.md index 7beac7c0b..133a9283a 100644 --- a/docs/content/providers/docker.md +++ b/docs/content/providers/docker.md @@ -496,7 +496,7 @@ Defines the polling interval (in seconds) in Swarm Mode. ### `httpClientTimeout` -_Optional, Default=32_ +_Optional, Default=0_ ```toml tab="File (TOML)" [providers.docker] @@ -516,7 +516,7 @@ providers: # ... ``` -Client timeout for HTTP connections (in seconds). +Defines the client timeout (in seconds) for HTTP connections. If zero, no timeout is set. ### `watch` diff --git a/docs/content/reference/static-configuration/cli-ref.md b/docs/content/reference/static-configuration/cli-ref.md index 29e6e7df6..051a69742 100644 --- a/docs/content/reference/static-configuration/cli-ref.md +++ b/docs/content/reference/static-configuration/cli-ref.md @@ -406,7 +406,7 @@ Docker server endpoint. Can be a tcp or a unix socket endpoint. (Default: ```uni Expose containers by default. (Default: ```true```) `--providers.docker.httpclienttimeout`: -Client timeout for HTTP connections. (Default: ```32```) +Client timeout for HTTP connections. (Default: ```0```) `--providers.docker.network`: Default Docker network used. diff --git a/docs/content/reference/static-configuration/env-ref.md b/docs/content/reference/static-configuration/env-ref.md index 588a779cf..b7d8812c3 100644 --- a/docs/content/reference/static-configuration/env-ref.md +++ b/docs/content/reference/static-configuration/env-ref.md @@ -406,7 +406,7 @@ Docker server endpoint. Can be a tcp or a unix socket endpoint. (Default: ```uni Expose containers by default. (Default: ```true```) `TRAEFIK_PROVIDERS_DOCKER_HTTPCLIENTTIMEOUT`: -Client timeout for HTTP connections. (Default: ```32```) +Client timeout for HTTP connections. (Default: ```0```) `TRAEFIK_PROVIDERS_DOCKER_NETWORK`: Default Docker network used. diff --git a/pkg/config/static/static_config.go b/pkg/config/static/static_config.go index d66946ee7..e26a620a2 100644 --- a/pkg/config/static/static_config.go +++ b/pkg/config/static/static_config.go @@ -213,8 +213,8 @@ func (c *Configuration) SetEffectiveConfiguration() { c.Providers.Docker.SwarmModeRefreshSeconds = ptypes.Duration(15 * time.Second) } - if c.Providers.Docker.HTTPClientTimeout <= 0 { - c.Providers.Docker.HTTPClientTimeout = ptypes.Duration(32 * time.Second) + if c.Providers.Docker.HTTPClientTimeout < 0 { + c.Providers.Docker.HTTPClientTimeout = 0 } } diff --git a/pkg/provider/docker/docker.go b/pkg/provider/docker/docker.go index 64458369e..5ed6a7708 100644 --- a/pkg/provider/docker/docker.go +++ b/pkg/provider/docker/docker.go @@ -68,7 +68,6 @@ func (p *Provider) SetDefaults() { p.Endpoint = "unix:///var/run/docker.sock" p.SwarmMode = false p.SwarmModeRefreshSeconds = ptypes.Duration(15 * time.Second) - p.HTTPClientTimeout = ptypes.Duration(32 * time.Second) p.DefaultRule = DefaultTemplateRule }