diff --git a/apis/fluentbit/v1alpha2/clusterfluentbitconfig_types.go b/apis/fluentbit/v1alpha2/clusterfluentbitconfig_types.go index dc4183438..2b7c64721 100644 --- a/apis/fluentbit/v1alpha2/clusterfluentbitconfig_types.go +++ b/apis/fluentbit/v1alpha2/clusterfluentbitconfig_types.go @@ -170,7 +170,15 @@ func (s *Service) Params() *params.KVs { m.Insert("Log_Level", s.LogLevel) } if s.ParsersFile != "" { - m.Insert("Parsers_File", s.ParsersFile) + if s.ParsersFile == "parsers.conf" { + // For backwards compatibility, if the "usual" parsers.conf is + // configured, actually write the fully-qualified path in order + // to not break hot-reload. + // See https://github.com/fluent/fluent-bit/issues/8275. + m.Insert("Parsers_File", "/fluent-bit/etc/parsers.conf") + } else { + m.Insert("Parsers_File", s.ParsersFile) + } } if s.Storage != nil { if s.Storage.Path != "" { diff --git a/apis/fluentbit/v1alpha2/clusterfluentbitconfig_types_test.go b/apis/fluentbit/v1alpha2/clusterfluentbitconfig_types_test.go index c47bc9b8c..ea4b7fcb3 100644 --- a/apis/fluentbit/v1alpha2/clusterfluentbitconfig_types_test.go +++ b/apis/fluentbit/v1alpha2/clusterfluentbitconfig_types_test.go @@ -19,7 +19,7 @@ var expected = `[Service] Grace 30 Http_Server true Log_Level info - Parsers_File parsers.conf + Parsers_File /fluent-bit/etc/parsers.conf [Input] Name tail Alias input0_alias @@ -104,7 +104,7 @@ var expectedK8s = `[Service] Grace 30 Http_Server true Log_Level info - Parsers_File parsers.conf + Parsers_File /fluent-bit/etc/parsers.conf [Input] Name tail Path /var/log/containers/*.log