1
0
Fork 0

Add health check timeout parameter

This commit is contained in:
Jared Biel 2018-09-27 13:16:03 -05:00 committed by Traefiker Bot
parent f10516deb7
commit 5acd43efaf
45 changed files with 189 additions and 28 deletions

View file

@ -260,6 +260,7 @@ func TestProviderBuildConfiguration(t *testing.T) {
withPair(pathBackendHealthCheckPath, "/health"),
withPair(pathBackendHealthCheckPort, "80"),
withPair(pathBackendHealthCheckInterval, "30s"),
withPair(pathBackendHealthCheckTimeout, "5s"),
withPair(pathBackendHealthCheckHostname, "foo.com"),
withPair(pathBackendHealthCheckHeaders+"Foo", "bar"),
withPair(pathBackendHealthCheckHeaders+"Bar", "foo"),
@ -387,6 +388,7 @@ func TestProviderBuildConfiguration(t *testing.T) {
Path: "/health",
Port: 80,
Interval: "30s",
Timeout: "5s",
Hostname: "foo.com",
Headers: map[string]string{
"Foo": "bar",
@ -1986,9 +1988,12 @@ func TestProviderGetHealthCheck(t *testing.T) {
backend("foo",
withPair(pathBackendHealthCheckPath, "/health"),
withPair(pathBackendHealthCheckPort, "80"),
withPair(pathBackendHealthCheckInterval, "10s"))),
withPair(pathBackendHealthCheckInterval, "10s"),
withPair(pathBackendHealthCheckTimeout, "3s"))),
expected: &types.HealthCheck{
Interval: "10s",
Timeout: "3s",
Path: "/health",
Port: 80,
},
@ -2001,6 +2006,7 @@ func TestProviderGetHealthCheck(t *testing.T) {
withPair(pathBackendHealthCheckPath, "/health"))),
expected: &types.HealthCheck{
Interval: "30s",
Timeout: "5s",
Path: "/health",
Port: 0,
},
@ -2011,7 +2017,8 @@ func TestProviderGetHealthCheck(t *testing.T) {
kvPairs: filler("traefik",
backend("foo",
withPair(pathBackendHealthCheckPort, "80"),
withPair(pathBackendHealthCheckInterval, "30s"))),
withPair(pathBackendHealthCheckInterval, "30s"),
withPair(pathBackendHealthCheckTimeout, "5s"))),
expected: nil,
},
}