Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion apis/fluentbit/v1alpha2/plugins/output/forward_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ type Forward struct {
SelfHostname string `json:"selfHostname,omitempty"`
// Retain metadata when forwarding in forward mode.
RetainMetadataInForwardMode *bool `json:"retainMetadataInForwardMode,omitempty"`
*plugins.TLS `json:"tls,omitempty"`
// Set to gzip to enable gzip compression. Incompatible with timeAsInteger set to true and with tags
// set dynamically using the Rewrite Tag filter. Requires Fluentd server v0.14.7 or later.
// +kubebuilder:validation:Enum:=gzip
Compress string `json:"compress,omitempty"`
*plugins.TLS `json:"tls,omitempty"`
// Include fluentbit networking options for this output-plugin
*plugins.Networking `json:"networking,omitempty"`
}
Expand Down Expand Up @@ -78,6 +82,7 @@ func (f *Forward) Params(sl plugins.SecretLoader) (*params.KVs, error) {
plugins.InsertKVString(kvs, "Tag", f.Tag)
plugins.InsertKVString(kvs, "Shared_Key", f.SharedKey)
plugins.InsertKVString(kvs, "Self_Hostname", f.SelfHostname)
plugins.InsertKVString(kvs, "Compress", f.Compress)

plugins.InsertKVField(kvs, "Port", f.Port)
plugins.InsertKVField(kvs, "Empty_Shared_Key", f.EmptySharedKey)
Expand Down
45 changes: 45 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/output/forward_types_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package output

import (
"testing"

"github.com/fluent/fluent-operator/v3/apis/fluentbit/v1alpha2/plugins"
"github.com/fluent/fluent-operator/v3/apis/fluentbit/v1alpha2/plugins/params"
. "github.com/onsi/gomega"
)

func TestOutput_Forward_Params(t *testing.T) {
g := NewGomegaWithT(t)

sl := plugins.NewSecretLoader(nil, "test namespace")

fwd := Forward{
Host: "fluentd.logging",
Port: new(int32(24224)),
Compress: "gzip",
}

expected := params.NewKVs()
expected.Insert("Host", "fluentd.logging")
expected.Insert("Compress", "gzip")
expected.Insert("Port", "24224")

kvs, err := fwd.Params(sl)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(kvs).To(Equal(expected))
}

func TestOutput_Forward_Params_NoCompress(t *testing.T) {
g := NewGomegaWithT(t)

sl := plugins.NewSecretLoader(nil, "test namespace")

fwd := Forward{Host: "fluentd.logging"}

expected := params.NewKVs()
expected.Insert("Host", "fluentd.logging")

kvs, err := fwd.Params(sl)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(kvs).To(Equal(expected))
}
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,13 @@ spec:
forward:
description: Forward defines Forward Output configuration.
properties:
compress:
description: |-
Set to gzip to enable gzip compression. Incompatible with timeAsInteger set to true and with tags
set dynamically using the Rewrite Tag filter. Requires Fluentd server v0.14.7 or later.
enum:
- gzip
type: string
emptySharedKey:
description: Use this option to connect to Fluentd with a zero-length
secret.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,13 @@ spec:
forward:
description: Forward defines Forward Output configuration.
properties:
compress:
description: |-
Set to gzip to enable gzip compression. Incompatible with timeAsInteger set to true and with tags
set dynamically using the Rewrite Tag filter. Requires Fluentd server v0.14.7 or later.
enum:
- gzip
type: string
emptySharedKey:
description: Use this option to connect to Fluentd with a zero-length
secret.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,13 @@ spec:
forward:
description: Forward defines Forward Output configuration.
properties:
compress:
description: |-
Set to gzip to enable gzip compression. Incompatible with timeAsInteger set to true and with tags
set dynamically using the Rewrite Tag filter. Requires Fluentd server v0.14.7 or later.
enum:
- gzip
type: string
emptySharedKey:
description: Use this option to connect to Fluentd with a zero-length
secret.
Expand Down
7 changes: 7 additions & 0 deletions charts/fluent-operator/crds/fluentbit.fluent.io_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,13 @@ spec:
forward:
description: Forward defines Forward Output configuration.
properties:
compress:
description: |-
Set to gzip to enable gzip compression. Incompatible with timeAsInteger set to true and with tags
set dynamically using the Rewrite Tag filter. Requires Fluentd server v0.14.7 or later.
enum:
- gzip
type: string
emptySharedKey:
description: Use this option to connect to Fluentd with a zero-length
secret.
Expand Down
7 changes: 7 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,13 @@ spec:
forward:
description: Forward defines Forward Output configuration.
properties:
compress:
description: |-
Set to gzip to enable gzip compression. Incompatible with timeAsInteger set to true and with tags
set dynamically using the Rewrite Tag filter. Requires Fluentd server v0.14.7 or later.
enum:
- gzip
type: string
emptySharedKey:
description: Use this option to connect to Fluentd with a zero-length
secret.
Expand Down
7 changes: 7 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,13 @@ spec:
forward:
description: Forward defines Forward Output configuration.
properties:
compress:
description: |-
Set to gzip to enable gzip compression. Incompatible with timeAsInteger set to true and with tags
set dynamically using the Rewrite Tag filter. Requires Fluentd server v0.14.7 or later.
enum:
- gzip
type: string
emptySharedKey:
description: Use this option to connect to Fluentd with a zero-length
secret.
Expand Down
1 change: 1 addition & 0 deletions docs/plugins/fluentbit/output/forward.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ Forward is the protocol used by Fluentd to route messages between peers. <br />
| password | Specify the password corresponding to the username. | *[plugins.Secret](../secret.md) |
| selfHostname | Default value of the auto-generated certificate common name (CN). | string |
| retainMetadataInForwardMode | Retain metadata when forwarding in forward mode. | *bool |
| compress | Set to gzip to enable gzip compression. Incompatible with timeAsInteger set to true and with tags set dynamically using the Rewrite Tag filter. Requires Fluentd server v0.14.7 or later. | string |
| tls | | *[plugins.TLS](../tls.md) |
| networking | Include fluentbit networking options for this output-plugin | *[plugins.Networking](../net.md) |
14 changes: 14 additions & 0 deletions manifests/setup/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5344,6 +5344,13 @@ spec:
forward:
description: Forward defines Forward Output configuration.
properties:
compress:
description: |-
Set to gzip to enable gzip compression. Incompatible with timeAsInteger set to true and with tags
set dynamically using the Rewrite Tag filter. Requires Fluentd server v0.14.7 or later.
enum:
- gzip
type: string
emptySharedKey:
description: Use this option to connect to Fluentd with a zero-length
secret.
Expand Down Expand Up @@ -36849,6 +36856,13 @@ spec:
forward:
description: Forward defines Forward Output configuration.
properties:
compress:
description: |-
Set to gzip to enable gzip compression. Incompatible with timeAsInteger set to true and with tags
set dynamically using the Rewrite Tag filter. Requires Fluentd server v0.14.7 or later.
enum:
- gzip
type: string
emptySharedKey:
description: Use this option to connect to Fluentd with a zero-length
secret.
Expand Down
Loading