Skip to content

Commit 0d49bdf

Browse files
committed
MINOR: configuration: add shards option to bind
1 parent 90efe54 commit 0d49bdf

13 files changed

Lines changed: 71 additions & 2 deletions

File tree

config-parser/params/bind-options.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ func getBindOptions() []BindOption {
205205
&BindOptionValue{Name: "ocsp-update"},
206206
&BindOptionValue{Name: "process"},
207207
&BindOptionValue{Name: "proto"},
208+
&BindOptionValue{Name: "shards"},
208209
&BindOptionValue{Name: "sigalgs"},
209210
&BindOptionValue{Name: "ssl-max-ver"},
210211
&BindOptionValue{Name: "ssl-min-ver"},

config-parser/tests/bind_generated_test.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config-parser/tests/configs/haproxy_generated.cfg.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config-parser/tests/integration/frontend_data_test.go

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config-parser/tests/integration/frontend_test.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config-parser/types/types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ type ACL struct {
259259
//test:ok:bind :443 nbconn +2
260260
//test:ok:bind :443 guid-prefix guid-example
261261
//test:ok:bind :443 default-crt foobar.pem.rsa default-crt foobar.pem.ecdsa
262+
//test:ok:bind :443 shards 4
263+
//test:ok:bind :443 shards by-thread
264+
//test:ok:bind :443 shards by-group
262265
type Bind struct {
263266
Path string // can be address:port or socket path
264267
Params []params.BindOption

configuration/bind.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ func parseBindParams(bindOptions []params.BindOption) models.BindParams { //noli
372372
b.Npn = v.Value
373373
case "proto":
374374
b.Proto = v.Value
375+
case "shards":
376+
b.Shards = v.Value
375377
case "sigalgs":
376378
b.Sigalgs = v.Value
377379
case "ssl-max-ver":
@@ -587,6 +589,9 @@ func serializeBindParams(b models.BindParams, path string) []params.BindOption {
587589
if b.Proto != "" {
588590
options = append(options, &params.BindOptionValue{Name: "proto", Value: b.Proto})
589591
}
592+
if b.Shards != "" {
593+
options = append(options, &params.BindOptionValue{Name: "shards", Value: b.Shards})
594+
}
590595
if b.Sigalgs != "" {
591596
options = append(options, &params.BindOptionValue{Name: "sigalgs", Value: b.Sigalgs})
592597
}

models/bind_params.go

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/bind_params_compare_test.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/bindparams_diff_generated.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)