Skip to content

Commit

Permalink
haproxy-config.template: Fix power-of-two balancing
Browse files Browse the repository at this point in the history
Update the set of allowed balancing algorithms to include "random", i.e.,
the "Power of Two Random Choices" algorithm.  An earlier commit was
supposed to make "random" the default algorithm but failed to add it to the
set of allowed algorithms.  As a result, the template would configure
HAProxy to the "roundrobin" algorithm by default.  This commit makes it so
the effective default is "random", as intended in the earlier commit.

Follow-up to commit dbc994c.

This commit fixes bug 1988801.

https://bugzilla.redhat.com/show_bug.cgi?id=1988801

* images/router/haproxy/conf/haproxy-config.template: Fix
$balanceAlgoPattern to match "random".
  • Loading branch information
Miciah authored and openshift-cherrypick-robot committed Aug 5, 2021
1 parent ce65730 commit 5dc97a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion images/router/haproxy/conf/haproxy-config.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{- $cookieNamePattern := `[a-zA-Z0-9_-]+` -}}

{{- /* balanceAlgoPattern matches valid options for the haproxy.router.openshift.io/balance annotation. */}}
{{- $balanceAlgoPattern := "roundrobin|leastconn|source" -}}
{{- $balanceAlgoPattern := "roundrobin|leastconn|source|random" -}}

{{- $timeSpecPattern := `[1-9][0-9]*(us|ms|s|m|h|d)?` }}

Expand Down

0 comments on commit 5dc97a4

Please sign in to comment.