refactor(mesos): template readability.
This commit is contained in:
parent
f1f2e1bf64
commit
e9d2124885
1 changed files with 26 additions and 15 deletions
|
@ -1,18 +1,29 @@
|
||||||
{{ $apps := .Applications }}
|
{{ $apps := .Applications }}
|
||||||
[backends]{{range .Tasks}}
|
|
||||||
[backends.backend{{getBackend . $apps}}.servers.server-{{getID .}}]
|
[backends]
|
||||||
url = "{{getProtocol . $apps}}://{{getHost .}}:{{getPort . $apps}}"
|
{{range $task := .Tasks }}
|
||||||
weight = {{getWeight . $apps}}
|
{{ $backendName := getBackend $task $apps }}
|
||||||
|
|
||||||
|
[backends.backend-{{ $backendName }}.servers.server-{{ getID $task }}]
|
||||||
|
url = "{{ getProtocol $task $apps }}://{{ getHost $task }}:{{ getPort $task $apps }}"
|
||||||
|
weight = {{ getWeight $task $apps }}
|
||||||
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
[frontends]{{range .Applications}}
|
[frontends]
|
||||||
[frontends.frontend-{{getFrontEndName .}}]
|
{{range $app := $apps }}
|
||||||
backend = "backend{{getFrontendBackend .}}"
|
{{ $frontendName := getFrontEndName $app }}
|
||||||
passHostHeader = {{getPassHostHeader .}}
|
|
||||||
priority = {{getPriority .}}
|
[frontends.frontend-{{ $frontendName }}]
|
||||||
entryPoints = [{{range getEntryPoints .}}
|
backend = "backend-{{ getFrontendBackend $app }}"
|
||||||
|
priority = {{ getPriority $app }}
|
||||||
|
passHostHeader = {{ getPassHostHeader $app }}
|
||||||
|
|
||||||
|
entryPoints = [{{range getEntryPoints $app }}
|
||||||
"{{.}}",
|
"{{.}}",
|
||||||
{{end}}]
|
{{end}}]
|
||||||
[frontends.frontend-{{getFrontEndName .}}.routes.route-host{{getFrontEndName .}}]
|
|
||||||
rule = "{{getFrontendRule .}}"
|
[frontends.frontend-{{ $frontendName }}.routes.route-host-{{ $frontendName }}]
|
||||||
|
rule = "{{ getFrontendRule $app }}"
|
||||||
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
Loading…
Reference in a new issue