1
0
Fork 0

Make Traefik health checks label-configurable with Marathon.

For the two existing health check parameters (path and interval), we add
support for Marathon labels.

Changes in detail:

- Extend the Marathon provider and template.
- Refactor Server.loadConfig to reduce duplication.
- Refactor the healthcheck package slightly to accommodate the changes
  and allow extending by future parameters.
- Update documentation.
This commit is contained in:
Timo Reimann 2017-03-15 19:16:06 +01:00
parent 441d5442a1
commit d57f83c31c
8 changed files with 371 additions and 45 deletions

View file

@ -148,12 +148,16 @@ func TestSetBackendsConfiguration(t *testing.T) {
defer ts.Close()
lb := &testLoadBalancer{RWMutex: &sync.RWMutex{}}
backend := NewBackendHealthCheck("/path", healthCheckInterval, lb)
backend := NewBackendHealthCheck(Options{
Path: "/path",
Interval: healthCheckInterval,
LB: lb,
})
serverURL := MustParseURL(ts.URL)
if test.startHealthy {
lb.servers = append(lb.servers, serverURL)
} else {
backend.DisabledURLs = append(backend.DisabledURLs, serverURL)
backend.disabledURLs = append(backend.disabledURLs, serverURL)
}
healthCheck := HealthCheck{