Skip to content

Commit

Permalink
Merge pull request #1051 from markusthoemmes/rework-fluent-bit-watcher
Browse files Browse the repository at this point in the history
Rework fluent-bit-watcher and make use of the hot-reload mechanism
  • Loading branch information
benjaminhuo authored Feb 18, 2024
2 parents af0bf32 + 468acdc commit 2f254cc
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 243 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
Loading

0 comments on commit 2f254cc

Please sign in to comment.