Skip to content

Commit

Permalink
fix(http): rename reuse_connection to reuse_connections for consisten…
Browse files Browse the repository at this point in the history
…cy. test(http): added test for new parameters

Signed-off-by: Iacob Nicolaev <[email protected]>
  • Loading branch information
iasha102 committed Jan 6, 2025
1 parent d072cea commit 89ad4e6
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2902,7 +2902,7 @@ spec:
items:
type: integer
type: array
reuse_connection:
reuse_connections:
type: boolean
slow_flush_log_threshold:
type: string
Expand Down Expand Up @@ -10349,7 +10349,7 @@ spec:
items:
type: integer
type: array
reuse_connection:
reuse_connections:
type: boolean
slow_flush_log_threshold:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2898,7 +2898,7 @@ spec:
items:
type: integer
type: array
reuse_connection:
reuse_connections:
type: boolean
slow_flush_log_threshold:
type: string
Expand Down Expand Up @@ -9619,7 +9619,7 @@ spec:
items:
type: integer
type: array
reuse_connection:
reuse_connections:
type: boolean
slow_flush_log_threshold:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2899,7 +2899,7 @@ spec:
items:
type: integer
type: array
reuse_connection:
reuse_connections:
type: boolean
slow_flush_log_threshold:
type: string
Expand Down Expand Up @@ -10346,7 +10346,7 @@ spec:
items:
type: integer
type: array
reuse_connection:
reuse_connections:
type: boolean
slow_flush_log_threshold:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2895,7 +2895,7 @@ spec:
items:
type: integer
type: array
reuse_connection:
reuse_connections:
type: boolean
slow_flush_log_threshold:
type: string
Expand Down Expand Up @@ -9616,7 +9616,7 @@ spec:
items:
type: integer
type: array
reuse_connection:
reuse_connections:
type: boolean
slow_flush_log_threshold:
type: string
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/logging.banzaicloud.io_clusteroutputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2899,7 +2899,7 @@ spec:
items:
type: integer
type: array
reuse_connection:
reuse_connections:
type: boolean
slow_flush_log_threshold:
type: string
Expand Down Expand Up @@ -10346,7 +10346,7 @@ spec:
items:
type: integer
type: array
reuse_connection:
reuse_connections:
type: boolean
slow_flush_log_threshold:
type: string
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/logging.banzaicloud.io_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2895,7 +2895,7 @@ spec:
items:
type: integer
type: array
reuse_connection:
reuse_connections:
type: boolean
slow_flush_log_threshold:
type: string
Expand Down Expand Up @@ -9616,7 +9616,7 @@ spec:
items:
type: integer
type: array
reuse_connection:
reuse_connections:
type: boolean
slow_flush_log_threshold:
type: string
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/plugins/outputs/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ List of retryable response codes. If the response code is included in this list,
Default: [503]
### reuse_connection (bool, optional) {#output config-reuse_connection}
### reuse_connections (bool, optional) {#output config-reuse_connections}
Try to reuse connection. This will improve performance.
Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/logging/model/output/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type HTTPOutputConfig struct {
// TLS timeout in seconds.
SSLTimeout int `json:"ssl_timeout,omitempty"`
// Try to reuse connection. This will improve performance. (default: false)
ReuseConnection bool `json:"reuse_connection,omitempty"`
ReuseConnections bool `json:"reuse_connections,omitempty"`
// The default version of TLS transport. [TLSv1_1, TLSv1_2] (default: TLSv1_2)
TlsVersion string `json:"tls_version,omitempty"`
// The cipher configuration of TLS transport. (default: ALL:!aNULL:!eNULL:!SSLv2)
Expand Down
8 changes: 7 additions & 1 deletion pkg/sdk/logging/model/output/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ import (

func TestHTTP(t *testing.T) {
CONFIG := []byte(`
compress: gzip
endpoint: http://logserver.com:9000/api
headers_from_placeholders: {"x-foo-bar":"${$.foo.bar}","x-tag":"app-${tag}"}
retryable_response_codes: [503,504]
reuse_connections: true
format:
type: json
buffer:
Expand All @@ -44,8 +47,11 @@ auth:
<match **>
@type http
@id test
compress gzip
endpoint http://logserver.com:9000/api
retryable_response_codes [503,504]
headers_from_placeholders {"x-foo-bar":"${$.foo.bar}","x-tag":"app-${tag}"}
retryable_response_codes [503,504]
reuse_connections true
<buffer tag,time>
@type file
path /buffers/test.*.buffer
Expand Down

0 comments on commit 89ad4e6

Please sign in to comment.