refacto(constraint-kv): Move constraint checking out of template
This commit is contained in:
parent
013808956c
commit
ced69b8397
2 changed files with 16 additions and 11 deletions
|
@ -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 .}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue