Skip to content

Commit b7dc3d7

Browse files
authored
Merge branch 'master' into adds-support-for-workers-syslog
2 parents 5919f7f + 84a3076 commit b7dc3d7

11 files changed

Lines changed: 97 additions & 9 deletions

apis/fluentbit/v1alpha2/clusterfluentbitconfig_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ type Service struct {
126126
SchedulerBase *int32 `json:"schedulerBase,omitempty"`
127127
// Set a maximum retry time in seconds for the scheduler. Supported in Fluent Bit >= 1.8.7
128128
SchedulerCap *int32 `json:"schedulerCap,omitempty"`
129+
// Set a default buffer size limit for multiline parsers. The value must be according to the Unit Size specification.
130+
// +kubebuilder:validation:Pattern:="^\\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$"
131+
MultilineBufferLimit string `json:"multilineBufferLimit,omitempty"`
129132
}
130133

131134
// +kubebuilder:object:root=true
@@ -243,6 +246,9 @@ func (s *Service) Params() *params.KVs {
243246
if s.SchedulerCap != nil {
244247
m.Insert("scheduler.cap", fmt.Sprint(*s.SchedulerCap))
245248
}
249+
if s.MultilineBufferLimit != "" {
250+
m.Insert("multiline_buffer_limit", s.MultilineBufferLimit)
251+
}
246252
return m
247253
}
248254

apis/fluentbit/v1alpha2/clusterfluentbitconfig_types_test.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,47 @@ func TestRenderMainConfigK8sInYaml(t *testing.T) {
11841184
g.Expect(yamlConfig).To(Equal(expectedK8sYamlWithClusterFilterOutput))
11851185
}
11861186

1187+
func TestClusterFluentBitConfig_Service_MultilineBufferLimit(t *testing.T) {
1188+
g := NewGomegaWithT(t)
1189+
sl := plugins.NewSecretLoader(nil, "testnamespace")
1190+
1191+
cfbc := ClusterFluentBitConfig{
1192+
Spec: FluentBitConfigSpec{
1193+
Service: &Service{
1194+
Daemon: utils.ToPtr(false),
1195+
FlushSeconds: utils.ToPtr[float64](1),
1196+
MultilineBufferLimit: "5MB",
1197+
},
1198+
},
1199+
}
1200+
1201+
expectedClassic := `[Service]
1202+
Daemon false
1203+
Flush 1
1204+
multiline_buffer_limit 5MB
1205+
`
1206+
expectedYamlFmt := `service:
1207+
daemon: false
1208+
flush: 1
1209+
multiline_buffer_limit: 5MB
1210+
pipeline:
1211+
inputs:
1212+
outputs:
1213+
`
1214+
1215+
config, err := cfbc.RenderMainConfig(
1216+
sl, ClusterInputList{}, ClusterFilterList{}, ClusterOutputList{}, nil, nil, nil,
1217+
)
1218+
g.Expect(err).NotTo(HaveOccurred())
1219+
g.Expect(config).To(Equal(expectedClassic))
1220+
1221+
yamlConfig, err := cfbc.RenderMainConfigInYaml(
1222+
sl, ClusterInputList{}, ClusterFilterList{}, ClusterOutputList{}, nil, nil, nil,
1223+
)
1224+
g.Expect(err).NotTo(HaveOccurred())
1225+
g.Expect(yamlConfig).To(Equal(expectedYamlFmt))
1226+
}
1227+
11871228
func TestClusterFluentBitConfig_RenderMainConfig_WithParsersFiles(t *testing.T) {
11881229
g := NewGomegaWithT(t)
11891230
sl := plugins.NewSecretLoader(nil, "testnamespace")

charts/fluent-bit-crds/templates/fluentbit.fluent.io_clusterfluentbitconfigs.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,11 @@ spec:
372372
- debug
373373
- trace
374374
type: string
375+
multilineBufferLimit:
376+
description: Set a default buffer size limit for multiline parsers.
377+
The value must be according to the Unit Size specification.
378+
pattern: ^\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$
379+
type: string
375380
parsersFile:
376381
description: Optional 'parsers' config file (can be multiple)
377382
type: string

charts/fluent-bit-crds/templates/fluentbit.fluent.io_fluentbitconfigs.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,11 @@ spec:
404404
- debug
405405
- trace
406406
type: string
407+
multilineBufferLimit:
408+
description: Set a default buffer size limit for multiline parsers.
409+
The value must be according to the Unit Size specification.
410+
pattern: ^\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$
411+
type: string
407412
parsersFile:
408413
description: Optional 'parsers' config file (can be multiple)
409414
type: string

config/crd/bases/fluentbit.fluent.io_clusterfluentbitconfigs.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,11 @@ spec:
369369
- debug
370370
- trace
371371
type: string
372+
multilineBufferLimit:
373+
description: Set a default buffer size limit for multiline parsers.
374+
The value must be according to the Unit Size specification.
375+
pattern: ^\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$
376+
type: string
372377
parsersFile:
373378
description: Optional 'parsers' config file (can be multiple)
374379
type: string

config/crd/bases/fluentbit.fluent.io_fluentbitconfigs.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,11 @@ spec:
401401
- debug
402402
- trace
403403
type: string
404+
multilineBufferLimit:
405+
description: Set a default buffer size limit for multiline parsers.
406+
The value must be according to the Unit Size specification.
407+
pattern: ^\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$
408+
type: string
404409
parsersFile:
405410
description: Optional 'parsers' config file (can be multiple)
406411
type: string

docs/fluentbit.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ ParserSpec defines the desired state of ClusterParser
646646
| hotReload | If true enable reloading via HTTP | *bool |
647647
| schedulerBase | Set a base for exponential backoff in the scheduler. Supported in Fluent Bit >= 1.8.7 | *int32 |
648648
| schedulerCap | Set a maximum retry time in seconds for the scheduler. Supported in Fluent Bit >= 1.8.7 | *int32 |
649+
| multilineBufferLimit | Set a default buffer size limit for multiline parsers. The value must be according to the Unit Size specification. | string |
649650

650651
[Back to TOC](#table-of-contents)
651652
# Storage

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ require (
1212
github.com/onsi/ginkgo/v2 v2.28.1
1313
github.com/onsi/gomega v1.39.1
1414
golang.org/x/sync v0.19.0
15-
k8s.io/api v0.35.0
16-
k8s.io/apimachinery v0.35.0
17-
k8s.io/client-go v0.35.0
15+
k8s.io/api v0.35.1
16+
k8s.io/apimachinery v0.35.1
17+
k8s.io/client-go v0.35.1
1818
k8s.io/klog/v2 v2.130.1
1919
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4
2020
sigs.k8s.io/controller-runtime v0.23.1

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,16 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
230230
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
231231
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
232232
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
233-
k8s.io/api v0.35.0 h1:iBAU5LTyBI9vw3L5glmat1njFK34srdLmktWwLTprlY=
234-
k8s.io/api v0.35.0/go.mod h1:AQ0SNTzm4ZAczM03QH42c7l3bih1TbAXYo0DkF8ktnA=
233+
k8s.io/api v0.35.1 h1:0PO/1FhlK/EQNVK5+txc4FuhQibV25VLSdLMmGpDE/Q=
234+
k8s.io/api v0.35.1/go.mod h1:28uR9xlXWml9eT0uaGo6y71xK86JBELShLy4wR1XtxM=
235235
k8s.io/apiextensions-apiserver v0.35.0 h1:3xHk2rTOdWXXJM+RDQZJvdx0yEOgC0FgQ1PlJatA5T4=
236236
k8s.io/apiextensions-apiserver v0.35.0/go.mod h1:E1Ahk9SADaLQ4qtzYFkwUqusXTcaV2uw3l14aqpL2LU=
237-
k8s.io/apimachinery v0.35.0 h1:Z2L3IHvPVv/MJ7xRxHEtk6GoJElaAqDCCU0S6ncYok8=
238-
k8s.io/apimachinery v0.35.0/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns=
237+
k8s.io/apimachinery v0.35.1 h1:yxO6gV555P1YV0SANtnTjXYfiivaTPvCTKX6w6qdDsU=
238+
k8s.io/apimachinery v0.35.1/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns=
239239
k8s.io/apiserver v0.35.0 h1:CUGo5o+7hW9GcAEF3x3usT3fX4f9r8xmgQeCBDaOgX4=
240240
k8s.io/apiserver v0.35.0/go.mod h1:QUy1U4+PrzbJaM3XGu2tQ7U9A4udRRo5cyxkFX0GEds=
241-
k8s.io/client-go v0.35.0 h1:IAW0ifFbfQQwQmga0UdoH0yvdqrbwMdq9vIFEhRpxBE=
242-
k8s.io/client-go v0.35.0/go.mod h1:q2E5AAyqcbeLGPdoRB+Nxe3KYTfPce1Dnu1myQdqz9o=
241+
k8s.io/client-go v0.35.1 h1:+eSfZHwuo/I19PaSxqumjqZ9l5XiTEKbIaJ+j1wLcLM=
242+
k8s.io/client-go v0.35.1/go.mod h1:1p1KxDt3a0ruRfc/pG4qT/3oHmUj1AhSHEcxNSGg+OA=
243243
k8s.io/component-base v0.35.0 h1:+yBrOhzri2S1BVqyVSvcM3PtPyx5GUxCK2tinZz1G94=
244244
k8s.io/component-base v0.35.0/go.mod h1:85SCX4UCa6SCFt6p3IKAPej7jSnF3L8EbfSyMZayJR0=
245245
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=

manifests/setup/fluent-operator-crd.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,6 +1830,11 @@ spec:
18301830
- debug
18311831
- trace
18321832
type: string
1833+
multilineBufferLimit:
1834+
description: Set a default buffer size limit for multiline parsers.
1835+
The value must be according to the Unit Size specification.
1836+
pattern: ^\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$
1837+
type: string
18331838
parsersFile:
18341839
description: Optional 'parsers' config file (can be multiple)
18351840
type: string
@@ -17088,6 +17093,11 @@ spec:
1708817093
- debug
1708917094
- trace
1709017095
type: string
17096+
multilineBufferLimit:
17097+
description: Set a default buffer size limit for multiline parsers.
17098+
The value must be according to the Unit Size specification.
17099+
pattern: ^\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$
17100+
type: string
1709117101
parsersFile:
1709217102
description: Optional 'parsers' config file (can be multiple)
1709317103
type: string

0 commit comments

Comments
 (0)