refactor(k8s): template readability.

fix(k8s): redirection template.
This commit is contained in:
Fernandez Ludovic 2018-01-05 11:53:31 +01:00 committed by Traefiker
parent 4497ddbb0e
commit 742dde72bb

View file

@ -10,9 +10,7 @@
[backends."{{ $backendName }}".loadBalancer]
method = "{{ $backend.LoadBalancer.Method }}"
{{if $backend.LoadBalancer.Sticky}}
sticky = true
{{end}}
sticky = {{ $backend.LoadBalancer.Sticky }}
{{if $backend.LoadBalancer.Stickiness }}
[backends."{{ $backendName }}".loadBalancer.stickiness]
cookieName = "{{ $backend.LoadBalancer.Stickiness.CookieName }}"
@ -64,9 +62,9 @@
{{if $frontend.Redirect }}
[frontends."{{ $frontendName }}".redirect]
entryPoint = "{{$frontend.RedirectEntryPoint}}"
regex = "{{$frontend.RedirectRegex}}"
replacement = "{{$frontend.RedirectReplacement}}"
entryPoint = "{{ $frontend.Redirect.EntryPoint }}"
regex = "{{ $frontend.Redirect.Regex }}"
replacement = "{{ $frontend.Redirect.Replacement }}"
{{end}}
{{if $frontend.Errors }}
@ -121,13 +119,13 @@
{{end}}]
{{end}}
{{if $frontend.Headers.CustomRequestHeaders }}
[frontends."{{$frontendName}}".headers.customrequestheaders]
[frontends."{{ $frontendName }}".headers.customRequestHeaders]
{{range $k, $v := $frontend.Headers.CustomRequestHeaders }}
{{ $k }} = "{{ $v }}"
{{end}}
{{end}}
{{if $frontend.Headers.CustomResponseHeaders }}
[frontends."{{$frontendName}}".headers.customresponseheaders]
[frontends."{{ $frontendName }}".headers.customResponseHeaders]
{{range $k, $v := $frontend.Headers.CustomResponseHeaders }}
{{ $k }} = "{{ $v }}"
{{end}}