diff --git a/marathon.go b/marathon.go index 4fec90691..16aaed3c7 100644 --- a/marathon.go +++ b/marathon.go @@ -31,7 +31,7 @@ var MarathonFuncMap = template.FuncMap{ return value } } - return strings.TrimPrefix(application.ID, "/") + return application.ID }, "replace": func(s1 string, s2 string, s3 string) string { return strings.Replace(s3, s1, s2, -1) diff --git a/marathon.tmpl b/marathon.tmpl index f59000417..e58998bf2 100644 --- a/marathon.tmpl +++ b/marathon.tmpl @@ -6,7 +6,7 @@ [routes]{{range .Applications}} [routes.route{{.ID | replace "/" "-"}}] backend = "backend{{.ID | replace "/" "-"}}" - [routes.route-{{getHost .}}.rules.rule-host-{{getHost .}}] + [routes.route-{{getHost . | replace "/" "-"}}.rules.rule-host-{{getHost . | replace "/" "-"}}] category = "Host" - value = "{{getHost .}}.{{$.Domain}}" + value = "{{getHost . | replace "/" "-"}}.{{$.Domain}}" {{end}} \ No newline at end of file