From edc55aad3cc39c0bb3bf4eb6347439a11206c680 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 16 Dec 2017 15:01:45 +0100 Subject: [PATCH] feat(marathon): add whitelistSourceRange label. --- provider/marathon/config.go | 1 + templates/marathon.tmpl | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/provider/marathon/config.go b/provider/marathon/config.go index 034099d26..24864b2b6 100644 --- a/provider/marathon/config.go +++ b/provider/marathon/config.go @@ -49,6 +49,7 @@ func (p *Provider) buildConfiguration() *types.Configuration { "getBasicAuth": getFuncSliceStringService(label.TraefikFrontendAuthBasic), "getServiceNames": getServiceNames, "getServiceNameSuffix": getServiceNameSuffix, + "getWhitelistSourceRange": getFuncSliceStringService(label.TraefikFrontendWhitelistSourceRange), } v := url.Values{} diff --git a/templates/marathon.tmpl b/templates/marathon.tmpl index 98db186eb..aea55bf18 100644 --- a/templates/marathon.tmpl +++ b/templates/marathon.tmpl @@ -62,6 +62,12 @@ "{{.}}", {{end}}] + {{if getWhitelistSourceRange $app $serviceName}} + whitelistSourceRange = [{{range getWhitelistSourceRange $app $serviceName}} + "{{.}}", + {{end}}] + {{end}} + basicAuth = [{{range getBasicAuth $app $serviceName}} "{{.}}", {{end}}]