Skip to content

Commit 1a75fb9

Browse files
solidDoWantcw-Guo
authored andcommitted
Add support for compression to the Fluentd HTTP output plugin
Signed-off-by: Fred Heinecke <[email protected]>
1 parent 3d63aff commit 1a75fb9

File tree

9 files changed

+64
-0
lines changed

9 files changed

+64
-0
lines changed

apis/fluentd/v1alpha1/plugins/output/http.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,7 @@ type Http struct {
4949
ErrorResponseAsUnrecoverable *bool `json:"errorResponseAsUnrecoverable,omitempty"`
5050
// The list of retryable response codes. If the response code is included in this list, out_http retries the buffer flush.
5151
RetryableResponseCodes *string `json:"retryableResponseCodes,omitempty"`
52+
// Compress enables the given compression method for HTTP requests.
53+
// +kubebuilder:validation:Enum:=text;gzip
54+
Compress *string `json:"compress,omitempty"`
5255
}

apis/fluentd/v1alpha1/plugins/output/types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@ func (o *Output) httpPlugin(parent *params.PluginStore, loader plugins.SecretLoa
387387
parent.InsertPairs("retryable_response_codes", fmt.Sprint(*o.Http.RetryableResponseCodes))
388388
}
389389

390+
if o.Http.Compress != nil {
391+
parent.InsertPairs("compress", fmt.Sprint(*o.Http.Compress))
392+
}
393+
390394
return parent
391395
}
392396

charts/fluent-operator/charts/fluentd-crds/crds/fluentd.fluent.io_clusteroutputs.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,6 +1868,13 @@ spec:
18681868
type: object
18691869
type: object
18701870
type: object
1871+
compress:
1872+
description: Compress enables the given compression method
1873+
for HTTP requests.
1874+
enum:
1875+
- text
1876+
- gzip
1877+
type: string
18711878
contentType:
18721879
description: ContentType defines Content-Type for HTTP request.
18731880
out_http automatically set Content-Type for built-in formatters

charts/fluent-operator/charts/fluentd-crds/crds/fluentd.fluent.io_outputs.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,6 +1868,13 @@ spec:
18681868
type: object
18691869
type: object
18701870
type: object
1871+
compress:
1872+
description: Compress enables the given compression method
1873+
for HTTP requests.
1874+
enum:
1875+
- text
1876+
- gzip
1877+
type: string
18711878
contentType:
18721879
description: ContentType defines Content-Type for HTTP request.
18731880
out_http automatically set Content-Type for built-in formatters

config/crd/bases/fluentd.fluent.io_clusteroutputs.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,6 +1868,13 @@ spec:
18681868
type: object
18691869
type: object
18701870
type: object
1871+
compress:
1872+
description: Compress enables the given compression method
1873+
for HTTP requests.
1874+
enum:
1875+
- text
1876+
- gzip
1877+
type: string
18711878
contentType:
18721879
description: ContentType defines Content-Type for HTTP request.
18731880
out_http automatically set Content-Type for built-in formatters

config/crd/bases/fluentd.fluent.io_outputs.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,6 +1868,13 @@ spec:
18681868
type: object
18691869
type: object
18701870
type: object
1871+
compress:
1872+
description: Compress enables the given compression method
1873+
for HTTP requests.
1874+
enum:
1875+
- text
1876+
- gzip
1877+
type: string
18711878
contentType:
18721879
description: ContentType defines Content-Type for HTTP request.
18731880
out_http automatically set Content-Type for built-in formatters

docs/plugins/fluentd/output/http.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ Http defines the parameters for out_http output plugin
2525
| tlsCiphers | TlsCiphers defines the cipher suites configuration of TLS. | *string |
2626
| errorResponseAsUnrecoverable | Raise UnrecoverableError when the response code is not SUCCESS. | *bool |
2727
| retryableResponseCodes | The list of retryable response codes. If the response code is included in this list, out_http retries the buffer flush. | *string |
28+
| compress | Compress enables the given compression method for HTTP requests. | *string |

manifests/setup/fluent-operator-crd.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10365,6 +10365,13 @@ spec:
1036510365
type: object
1036610366
type: object
1036710367
type: object
10368+
compress:
10369+
description: Compress enables the given compression method
10370+
for HTTP requests.
10371+
enum:
10372+
- text
10373+
- gzip
10374+
type: string
1036810375
contentType:
1036910376
description: ContentType defines Content-Type for HTTP request.
1037010377
out_http automatically set Content-Type for built-in formatters
@@ -39207,6 +39214,13 @@ spec:
3920739214
type: object
3920839215
type: object
3920939216
type: object
39217+
compress:
39218+
description: Compress enables the given compression method
39219+
for HTTP requests.
39220+
enum:
39221+
- text
39222+
- gzip
39223+
type: string
3921039224
contentType:
3921139225
description: ContentType defines Content-Type for HTTP request.
3921239226
out_http automatically set Content-Type for built-in formatters

manifests/setup/setup.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10365,6 +10365,13 @@ spec:
1036510365
type: object
1036610366
type: object
1036710367
type: object
10368+
compress:
10369+
description: Compress enables the given compression method
10370+
for HTTP requests.
10371+
enum:
10372+
- text
10373+
- gzip
10374+
type: string
1036810375
contentType:
1036910376
description: ContentType defines Content-Type for HTTP request.
1037010377
out_http automatically set Content-Type for built-in formatters
@@ -39207,6 +39214,13 @@ spec:
3920739214
type: object
3920839215
type: object
3920939216
type: object
39217+
compress:
39218+
description: Compress enables the given compression method
39219+
for HTTP requests.
39220+
enum:
39221+
- text
39222+
- gzip
39223+
type: string
3921039224
contentType:
3921139225
description: ContentType defines Content-Type for HTTP request.
3921239226
out_http automatically set Content-Type for built-in formatters

0 commit comments

Comments
 (0)