1
0
Fork 0

refacto(constraint-kv): Move constraint checking out of template

This commit is contained in:
Samuel BERTHE 2016-06-21 00:58:39 +02:00 committed by Emile Vauge
parent 013808956c
commit ced69b8397
No known key found for this signature in database
GPG key ID: D808B4C167352E59
2 changed files with 16 additions and 11 deletions

View file

@ -3,7 +3,7 @@
[backends]{{range $backends}}
{{$backend := .}}
{{$servers := List $backend "/servers/" }}
{{$servers := ListServers $backend }}
{{$circuitBreaker := Get "" . "/circuitbreaker/" "expression"}}
{{with $circuitBreaker}}
@ -28,13 +28,11 @@
{{end}}
{{range $servers}}
{{if ne (CheckConstraints "" . "/tags") "false"}}
[backends."{{Last $backend}}".servers."{{Last .}}"]
url = "{{Get "" . "/url"}}"
weight = {{Get "" . "/weight"}}
{{end}}
{{end}}
{{end}}
[frontends]{{range $frontends}}
{{$frontend := Last .}}