Skip to content

Commit

Permalink
Fully qualify default parsers.conf
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Thömmes <[email protected]>
  • Loading branch information
markusthoemmes committed Jan 31, 2024
1 parent 051ca71 commit 468acdc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion apis/fluentbit/v1alpha2/clusterfluentbitconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down
4 changes: 2 additions & 2 deletions apis/fluentbit/v1alpha2/clusterfluentbitconfig_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 468acdc

Please sign in to comment.