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 55dea07647
commit b220225e14

View file

@ -314,13 +314,11 @@ http {
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 }}
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 }}
{{ if (gt $cfg.UpstreamKeepaliveConnections 0) }}