Skip to content

Commit

Permalink
BUG/MINOR: add missing hash-balance-factor for defaults and backend
Browse files Browse the repository at this point in the history
  • Loading branch information
hdurand0710 authored and mjuraga committed Apr 15, 2024
1 parent 1ae9385 commit cc8ae3b
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 10 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/google/go-cmp v0.6.0
github.com/google/renameio v1.0.1
github.com/google/uuid v1.6.0
github.com/haproxytech/config-parser/v5 v5.1.1-0.20240326140233-2ebfd8254626
github.com/haproxytech/config-parser/v5 v5.1.1-0.20240408103122-267515d6336b
github.com/json-iterator/go v1.1.12
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/mitchellh/mapstructure v1.5.0
Expand Down Expand Up @@ -40,6 +40,6 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
go.mongodb.org/mongo-driver v1.13.1 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/sys v0.19.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ github.com/google/renameio v1.0.1 h1:Lh/jXZmvZxb0BBeSY5VKEfidcbcbenKjZFzM/q0fSeU
github.com/google/renameio v1.0.1/go.mod h1:t/HQoYBZSsWSNK35C6CO/TpPLDVWvxOHboWUAweKUpk=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/haproxytech/config-parser/v5 v5.1.1-0.20240326140233-2ebfd8254626 h1:fDNM12Gd7IKzxtFxTTMWPMfnVvOuJmLuKDHA+Gs9oHY=
github.com/haproxytech/config-parser/v5 v5.1.1-0.20240326140233-2ebfd8254626/go.mod h1:dtksMYl/vyh+6M6Bkwx9d5Mvz0jVNR4AHPJoyfscPFA=
github.com/haproxytech/config-parser/v5 v5.1.1-0.20240408103122-267515d6336b h1:7mp51CTK3V+D7c7CInseuMBhFSaQU0mf2gs8z0pzZbU=
github.com/haproxytech/config-parser/v5 v5.1.1-0.20240408103122-267515d6336b/go.mod h1:T2iWRfXW84pxyk3PlYresm1ntHodIWgBN6ZxzB5Yqow=
github.com/haproxytech/go-logger v1.1.0 h1:HgGtYaI1ApkvbQdsm7f9AzQQoxTB7w37criTflh7IQE=
github.com/haproxytech/go-logger v1.1.0/go.mod h1:OekUd8HCb7ubxMplzHUPBTHNxZmddOWfOjWclZsqIeM=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
Expand Down Expand Up @@ -102,8 +102,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
3 changes: 3 additions & 0 deletions models/backend.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions models/backend_compare.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions models/backend_compare_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions models/defaults.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions models/defaults_compare.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions models/defaults_compare_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions specification/build/haproxy_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2126,6 +2126,9 @@ definitions:
- disabled
type: string
x-display-name: H1 Adjust Bogus Server
hash_balance_factor:
type: integer
x-nullable: true
hash_type:
$ref: '#/definitions/hash_type'
http-buffer-request:
Expand Down Expand Up @@ -2906,6 +2909,9 @@ definitions:
mode:
value: http
x-display-name: H1 Adjust Bogus Server
hash_balance_factor:
type: integer
x-nullable: true
hash_type:
$ref: '#/definitions/hash_type'
http-buffer-request:
Expand Down
3 changes: 3 additions & 0 deletions specification/models/configuration/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ backend:
$ref: "#/definitions/persist_rule"
hash_type:
$ref: "#/definitions/hash_type"
hash_balance_factor:
type: integer
x-nullable: true
http-check:
$ref: "#/definitions/http_check"
bind_process:
Expand Down
3 changes: 3 additions & 0 deletions specification/models/configuration/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ defaults:
$ref: "#/definitions/balance"
hash_type:
$ref: "#/definitions/hash_type"
hash_balance_factor:
type: integer
x-nullable: true
persist_rule:
$ref: "#/definitions/persist_rule"
maxconn:
Expand Down
2 changes: 2 additions & 0 deletions test/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ defaults test_defaults
mode http
bind-process 1-4
balance roundrobin
hash-balance-factor 150
defaults test_defaults_2 from test_defaults
option srvtcpka
Expand Down Expand Up @@ -637,6 +638,7 @@ backend test
balance roundrobin
bind-process all
hash-type consistent sdbm avalanche
hash-balance-factor 150
log-tag bla
option http-keep-alive
option forwardfor header X-Forwarded-For
Expand Down
2 changes: 2 additions & 0 deletions test/expected/structured.json
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@
"method": "consistent",
"modifier": "avalanche"
},
"hash_balance_factor": 150,
"http-check": {
"index": 0,
"type": "connect"
Expand Down Expand Up @@ -2963,6 +2964,7 @@
"algorithm": "roundrobin"
},
"bind_process": "1-4",
"hash_balance_factor": 150,
"maxconn": 2000,
"mode": "http",
"name": "test_defaults"
Expand Down

0 comments on commit cc8ae3b

Please sign in to comment.