1
0
mirror of https://github.com/containous/traefik.git synced 2024-12-22 13:34:03 +03:00

feat(marathon): add HealthCheck port label.

This commit is contained in:
Fernandez Ludovic 2017-12-16 14:47:49 +01:00 committed by Traefiker
parent 4524cdc151
commit 81e3b2dd4c
2 changed files with 8 additions and 0 deletions

View File

@ -43,6 +43,7 @@ func (p *Provider) buildConfiguration() *types.Configuration {
"getStickinessCookieName": getFuncString(label.TraefikBackendLoadBalancerStickinessCookieName, ""),
"hasHealthCheckLabels": hasFunc(label.TraefikBackendHealthCheckPath),
"getHealthCheckPath": getFuncString(label.TraefikBackendHealthCheckPath, ""),
"getHealthCheckPort": getFuncInt(label.TraefikBackendHealthCheckPort, label.DefaultBackendHealthCheckPort),
"getHealthCheckInterval": getFuncString(label.TraefikBackendHealthCheckInterval, ""),
"getBasicAuth": getFuncSliceStringService(label.TraefikFrontendAuthBasic),
"getServiceNames": getServiceNames,
@ -414,3 +415,9 @@ func getFuncInt64(labelName string, defaultValue int64) func(application maratho
return label.GetInt64ValueP(application.Labels, labelName, defaultValue)
}
}
func getFuncInt(labelName string, defaultValue int) func(application marathon.Application) int {
return func(application marathon.Application) int {
return label.GetIntValueP(application.Labels, labelName, defaultValue)
}
}

View File

@ -30,6 +30,7 @@
{{ if hasHealthCheckLabels $app }}
[backends."{{getBackend $app $serviceName }}".healthCheck]
path = "{{getHealthCheckPath $app }}"
port = {{getHealthCheckPort $app}}
interval = "{{getHealthCheckInterval $app }}"
{{end}}