From c884c7bb8a2ba1ef305625dab0d034298f6b02bc Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 16 Dec 2017 14:18:37 +0100 Subject: [PATCH] feat(rancher): add WhitelistSourceRange label. --- provider/rancher/config.go | 1 + templates/rancher.tmpl | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/provider/rancher/config.go b/provider/rancher/config.go index ad204ec42..295658f42 100644 --- a/provider/rancher/config.go +++ b/provider/rancher/config.go @@ -40,6 +40,7 @@ func (p *Provider) buildConfiguration(services []rancherData) *types.Configurati "getRedirectEntryPoint": getFuncString(label.TraefikFrontendRedirectEntryPoint, label.DefaultFrontendRedirectEntryPoint), "getRedirectRegex": getFuncString(label.TraefikFrontendRedirectRegex, ""), "getRedirectReplacement": getFuncString(label.TraefikFrontendRedirectReplacement, ""), + "getWhitelistSourceRange": getFuncSliceString(label.TraefikFrontendWhitelistSourceRange), } // filter services diff --git a/templates/rancher.tmpl b/templates/rancher.tmpl index e29e3cfc3..3e9f278e3 100644 --- a/templates/rancher.tmpl +++ b/templates/rancher.tmpl @@ -44,6 +44,12 @@ "{{.}}", {{end}}] + {{if getWhitelistSourceRange $service}} + whitelistSourceRange = [{{range getWhitelistSourceRange $service}} + "{{.}}", + {{end}}] + {{end}} + basicAuth = [{{range getBasicAuth $service}} "{{.}}", {{end}}]