Skip to content

Commit 873c60f

Browse files
authored
Merge pull request #2026 from verdel/fix/fluentbit-config-include-cri-log-parser
fix: add Parsers_File to fluent-bit.conf if enableDockerParserCompatibilityForCRI is enabled
2 parents b6fb486 + 6f73652 commit 873c60f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pkg/resources/fluentbit/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ var fluentBitConfigTemplate = `
3535
{{- if .CustomParsers }}
3636
Parsers_File {{ .CustomParsers }}
3737
{{- end }}
38+
{{- if .CRIParser }}
39+
Parsers_File {{ .CRIParser }}
40+
{{- end }}
3841
Coro_Stack_Size {{ .CoroStackSize }}
3942
{{- if .Monitor.Enabled }}
4043
HTTP_Server On

pkg/resources/fluentbit/configsecret.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ type fluentBitConfig struct {
8282
SyslogNGOutput *syslogNGOutputConfig
8383
DefaultParsers string
8484
CustomParsers string
85+
CRIParser string
8586
HealthCheck *v1beta1.HealthCheck
8687
}
8788

@@ -246,6 +247,7 @@ func (r *Reconciler) configSecret() (runtime.Object, reconciler.DesiredState, er
246247
default:
247248
if r.Logging.Spec.EnableDockerParserCompatibilityForCRI {
248249
r.fluentbitSpec.InputTail.Parser = "cri-log-compatibility"
250+
input.CRIParser = fmt.Sprintf("%s/%s", OperatorConfigPath, CRIParserConfigName)
249251
} else {
250252
r.fluentbitSpec.InputTail.Parser = "cri"
251253
}

0 commit comments

Comments
 (0)