When upstream-hash-by annotation is used do not configure a lb algorithm (#1858)

This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-12-27 07:48:06 -03:00 committed by GitHub
parent 85d97df583
commit 54cfad0a07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -314,13 +314,11 @@ http {
upstream {{ $upstream.Name }} { upstream {{ $upstream.Name }} {
# Load balance algorithm; empty for round robin, which is the default
{{ if ne $cfg.LoadBalanceAlgorithm "round_robin" }}
{{ $cfg.LoadBalanceAlgorithm }};
{{ end }}
{{ if $upstream.UpstreamHashBy }} {{ if $upstream.UpstreamHashBy }}
hash {{ $upstream.UpstreamHashBy }} consistent; hash {{ $upstream.UpstreamHashBy }} consistent;
{{ else }}
# Load balance algorithm; empty for round robin, which is the default
{{ if ne $cfg.LoadBalanceAlgorithm "round_robin" }}{{ $cfg.LoadBalanceAlgorithm }};{{ end }}
{{ end }} {{ end }}
{{ if (gt $cfg.UpstreamKeepaliveConnections 0) }} {{ if (gt $cfg.UpstreamKeepaliveConnections 0) }}