Skip to content

Commit 03a1432

Browse files
committed
MINOR: configuration: add shards option to bind
1 parent 5aadc51 commit 03a1432

13 files changed

Lines changed: 73 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
@@ -300,6 +300,7 @@ var bindOptionFactoryMethods = map[string]func() BindOption{ //nolint:gochecknog
300300
"ocsp-update": func() BindOption { return &BindOptionValue{Name: "ocsp-update"} },
301301
"process": func() BindOption { return &BindOptionValue{Name: "process"} },
302302
"proto": func() BindOption { return &BindOptionValue{Name: "proto"} },
303+
"shards": func() BindOption { return &BindOptionValue{Name: "shards"} },
303304
"sigalgs": func() BindOption { return &BindOptionValue{Name: "sigalgs"} },
304305
"ssl-max-ver": func() BindOption { return &BindOptionValue{Name: "ssl-max-ver"} },
305306
"ssl-min-ver": func() BindOption { return &BindOptionValue{Name: "ssl-min-ver"} },

config-parser/tests/bind_generated_test.go

Lines changed: 4 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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ type ACL struct {
264264
//test:ok:bind :443 default-crt foobar.pem.rsa default-crt foobar.pem.ecdsa
265265
//test:ok:bind :443 idle-ping 10s
266266
//test:ok:bind :443 idle-ping 10
267+
//test:ok:bind :443 shards 4
268+
//test:ok:bind :443 shards by-thread
269+
//test:ok:bind :443 shards by-group
270+
//test:fail:bind :443 shards
267271
//test:ok:bind :443 ssl tls-tickets
268272
//test:ok:bind :443 ssl no-strict-sni
269273
//test:fail:bind :443 idle-ping

configuration/bind.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ func parseBindParams(bindOptions []params.BindOption) models.BindParams { //noli
393393
b.Npn = v.Value
394394
case "proto":
395395
b.Proto = v.Value
396+
case "shards":
397+
b.Shards = v.Value
396398
case "sigalgs":
397399
b.Sigalgs = v.Value
398400
case "ssl-max-ver":
@@ -643,6 +645,9 @@ func serializeBindParams(b models.BindParams, path string, opt *options.Configur
643645
if b.Proto != "" {
644646
options = append(options, &params.BindOptionValue{Name: "proto", Value: b.Proto})
645647
}
648+
if b.Shards != "" {
649+
options = append(options, &params.BindOptionValue{Name: "shards", Value: b.Shards})
650+
}
646651
if b.Sigalgs != "" {
647652
options = append(options, &params.BindOptionValue{Name: "sigalgs", Value: b.Sigalgs})
648653
}

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)