1
0
Fork 0

Added support for templates to file provider

This commit is contained in:
Alex Antonov 2018-03-22 11:14:04 -04:00 committed by Traefiker Bot
parent d2e84a700f
commit 1a411b658b
5 changed files with 59 additions and 28 deletions

View file

@ -276,10 +276,13 @@ func createSubDir(t *testing.T, rootDir, dir string) string {
// createFrontendConfiguration Helper
func createFrontendConfiguration(n int) string {
conf := "[frontends]\n"
conf := "{{$home := env \"HOME\"}}\n[frontends]\n"
for i := 1; i <= n; i++ {
conf += fmt.Sprintf(` [frontends.frontend%[1]d]
conf += fmt.Sprintf(` [frontends."frontend%[1]d"]
backend = "backend%[1]d"
`, i)
conf += fmt.Sprintf(` [frontends."frontend%[1]d".headers]
"PublicKey" = "{{$home}}/pub.key"
`, i)
}
return conf