From e45e63dc373cc51d21f149bd2d33a6bd81d67cd1 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 16 Dec 2017 20:04:11 +0100 Subject: [PATCH] feat(ecs): add whitelistSourceRange label. --- provider/ecs/config.go | 1 + templates/ecs.tmpl | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/provider/ecs/config.go b/provider/ecs/config.go index cb623294b..7e53bdd82 100644 --- a/provider/ecs/config.go +++ b/provider/ecs/config.go @@ -40,6 +40,7 @@ func (p *Provider) buildConfiguration(services map[string][]ecsInstance) (*types "hasMaxConnLabels": hasMaxConnLabels, "getMaxConnAmount": getFuncFirstInt64Value(label.TraefikBackendMaxConnAmount, math.MaxInt64), "getMaxConnExtractorFunc": getFuncFirstStringValue(label.TraefikBackendMaxConnExtractorFunc, label.DefaultBackendMaxconnExtractorFunc), + "getWhitelistSourceRange": getFuncSliceString(label.TraefikFrontendWhitelistSourceRange), } return p.GetConfiguration("templates/ecs.tmpl", ecsFuncMap, struct { Services map[string][]ecsInstance diff --git a/templates/ecs.tmpl b/templates/ecs.tmpl index 54fee2b6c..44042ccc0 100644 --- a/templates/ecs.tmpl +++ b/templates/ecs.tmpl @@ -51,6 +51,12 @@ "{{.}}", {{end}}] + {{if getWhitelistSourceRange .}} + whitelistSourceRange = [{{range getWhitelistSourceRange .}} + "{{.}}", + {{end}}] + {{end}} + basicAuth = [{{range getBasicAuth .}} "{{.}}", {{end}}]