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}}]