From c6e986defb39ddd40d002269dceeaa574fc89102 Mon Sep 17 00:00:00 2001 From: Vincent Gramer Date: Thu, 23 Nov 2023 09:57:51 +0100 Subject: [PATCH] BUILD/MINOR: bump config parser dependency Signed-off-by: Vincent Gramer --- go.mod | 2 +- go.sum | 4 ++-- models/global.go | 3 +++ models/global_compare.go | 8 ++++++++ models/global_compare_test.go | 6 ++++-- specification/build/haproxy_spec.yaml | 3 +++ specification/models/configuration/global.yaml | 3 +++ 7 files changed, 24 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 76de1010..c7aacf59 100644 --- a/go.mod +++ b/go.mod @@ -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.3.1 - github.com/haproxytech/config-parser/v5 v5.0.1-0.20231123111836-e1d76c798b24 + github.com/haproxytech/config-parser/v5 v5.0.1-0.20231127082548-5bf41201fa06 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 diff --git a/go.sum b/go.sum index 23285c93..a6bc26f8 100644 --- a/go.sum +++ b/go.sum @@ -84,8 +84,8 @@ github.com/google/renameio v1.0.1/go.mod h1:t/HQoYBZSsWSNK35C6CO/TpPLDVWvxOHboWU github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/haproxytech/config-parser/v5 v5.0.1-0.20231123111836-e1d76c798b24 h1:xsQ1q84p9sISXGKVNZeUhyPe+XDICWA8pYyjuHHR24U= -github.com/haproxytech/config-parser/v5 v5.0.1-0.20231123111836-e1d76c798b24/go.mod h1:ASOyT1KguwXaY0NfoLNjLLs0OlnYHnFgUJsdJe6NhZg= +github.com/haproxytech/config-parser/v5 v5.0.1-0.20231127082548-5bf41201fa06 h1:rH6G2AgltdRSCRCSxtf4Kq3YfLO9LkD+nlI3eXdg2ZU= +github.com/haproxytech/config-parser/v5 v5.0.1-0.20231127082548-5bf41201fa06/go.mod h1:ASOyT1KguwXaY0NfoLNjLLs0OlnYHnFgUJsdJe6NhZg= github.com/haproxytech/go-logger v1.1.0 h1:HgGtYaI1ApkvbQdsm7f9AzQQoxTB7w37criTflh7IQE= github.com/haproxytech/go-logger v1.1.0/go.mod h1:OekUd8HCb7ubxMplzHUPBTHNxZmddOWfOjWclZsqIeM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= diff --git a/models/global.go b/models/global.go index df543f36..3a94031e 100644 --- a/models/global.go +++ b/models/global.go @@ -3057,6 +3057,9 @@ type GlobalTuneOptions struct { // comp maxlevel CompMaxlevel int64 `json:"comp_maxlevel,omitempty"` + // disable zero copy forwarding + DisableZeroCopyForwarding bool `json:"disable_zero_copy_forwarding,omitempty"` + // fail alloc FailAlloc bool `json:"fail_alloc,omitempty"` diff --git a/models/global_compare.go b/models/global_compare.go index b72c313e..bfe2972f 100644 --- a/models/global_compare.go +++ b/models/global_compare.go @@ -1785,6 +1785,10 @@ func (s GlobalTuneOptions) Equal(t GlobalTuneOptions, opts ...Options) bool { return false } + if s.DisableZeroCopyForwarding != t.DisableZeroCopyForwarding { + return false + } + if s.FailAlloc != t.FailAlloc { return false } @@ -2064,6 +2068,10 @@ func (s GlobalTuneOptions) Diff(t GlobalTuneOptions, opts ...Options) map[string diff["CompMaxlevel"] = []interface{}{s.CompMaxlevel, t.CompMaxlevel} } + if s.DisableZeroCopyForwarding != t.DisableZeroCopyForwarding { + diff["DisableZeroCopyForwarding"] = []interface{}{s.DisableZeroCopyForwarding, t.DisableZeroCopyForwarding} + } + if s.FailAlloc != t.FailAlloc { diff["FailAlloc"] = []interface{}{s.FailAlloc, t.FailAlloc} } diff --git a/models/global_compare_test.go b/models/global_compare_test.go index 92191749..f0ed277c 100644 --- a/models/global_compare_test.go +++ b/models/global_compare_test.go @@ -2715,6 +2715,7 @@ func TestGlobalTuneOptionsEqualFalse(t *testing.T) { result.BuffersReserve = sample.BuffersReserve + 1 result.Bufsize = sample.Bufsize + 1 result.CompMaxlevel = sample.CompMaxlevel + 1 + result.DisableZeroCopyForwarding = !sample.DisableZeroCopyForwarding result.FailAlloc = !sample.FailAlloc result.H2BeInitialWindowSize = sample.H2BeInitialWindowSize + 1 result.H2BeMaxConcurrentStreams = sample.H2BeMaxConcurrentStreams + 1 @@ -2854,6 +2855,7 @@ func TestGlobalTuneOptionsDiffFalse(t *testing.T) { result.BuffersReserve = sample.BuffersReserve + 1 result.Bufsize = sample.Bufsize + 1 result.CompMaxlevel = sample.CompMaxlevel + 1 + result.DisableZeroCopyForwarding = !sample.DisableZeroCopyForwarding result.FailAlloc = !sample.FailAlloc result.H2BeInitialWindowSize = sample.H2BeInitialWindowSize + 1 result.H2BeMaxConcurrentStreams = sample.H2BeMaxConcurrentStreams + 1 @@ -2917,7 +2919,7 @@ func TestGlobalTuneOptionsDiffFalse(t *testing.T) { for _, sample := range samples { result := sample.a.Diff(sample.b) - if len(result) != 67 { + if len(result) != 68 { json := jsoniter.ConfigCompatibleWithStandardLibrary a, err := json.Marshal(&sample.a) if err != nil { @@ -2927,7 +2929,7 @@ func TestGlobalTuneOptionsDiffFalse(t *testing.T) { if err != nil { t.Errorf(err.Error()) } - t.Errorf("Expected GlobalTuneOptions to be different in 67 cases, but it is not (%d) %s %s", len(result), a, b) + t.Errorf("Expected GlobalTuneOptions to be different in 68 cases, but it is not (%d) %s %s", len(result), a, b) } } } diff --git a/specification/build/haproxy_spec.yaml b/specification/build/haproxy_spec.yaml index 5d562227..4d255080 100644 --- a/specification/build/haproxy_spec.yaml +++ b/specification/build/haproxy_spec.yaml @@ -1574,6 +1574,9 @@ definitions: comp_maxlevel: type: integer x-display-name: Maximum Compression Level + disable_zero_copy_forwarding: + type: boolean + x-display-name: Disable zero-copy forwarding fail_alloc: type: boolean x-display-name: Failed Allocation Chance diff --git a/specification/models/configuration/global.yaml b/specification/models/configuration/global.yaml index c863eabe..1121582b 100644 --- a/specification/models/configuration/global.yaml +++ b/specification/models/configuration/global.yaml @@ -295,6 +295,9 @@ global: comp_maxlevel: type: integer x-display-name: Maximum Compression Level + disable_zero_copy_forwarding: + type: boolean + x-display-name: Disable zero-copy forwarding fail_alloc: type: boolean x-display-name: Failed Allocation Chance