Repository navigation
Conversation
Add mkdir to the File output so Fluent Bit creates the output directory recursively, instead of every path having to be mounted into the Fluent Bit pods. Fixes fluent#1618 Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
Comment on lines
+45
to
+47
| if f.Mkdir != nil { | ||
| kvs.Insert("Mkdir", fmt.Sprint(*f.Mkdir)) | ||
| } |
Collaborator
There was a problem hiding this comment.
Can we use the plugins.InsertKVString function?
Contributor
Author
There was a problem hiding this comment.
Done in a5b23da. Mkdir is a *bool, so I used plugins.InsertKVField, which also skips it when it's unset, rather than InsertKVString, which takes a string.
…dir option Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the
mkdiroption to the Fluent Bit file output, as requested in #1618. When it istrue, Fluent Bit creates the output directory recursively (with permissions 0755), so the whole path no longer has to be mounted into the Fluent Bit pods.mkdiris a*bool, so it is only written to the config when set (Mkdir trueorMkdir false), and existing outputs are unchanged.Changes:
apis/fluentbit/v1alpha2/plugins/output/file_types.go: the field and itsMkdirparameterzz_generated.deepcopy.go: the matching deepcopy for the pointerfile_types_test.go: the field set, unset andfalsedocs/plugins/fluentbit/output/file.mdand theoutputs/clusteroutputsCRDs inconfig/crd/bases, both charts andmanifests/setup/setup.yamlNotes
I used some help from AI. I reviewed the changes and the tests, please don't yell at me. Thx.
The issue was picked up in November 2025, but I couldn't find a PR for it. If someone is still working on it, I'm happy to close this one.
go test ./apis/fluentbit/v1alpha2/plugins/output/passes. The CRD YAML was edited by hand and matches what the generate-and-diff check in CI produces; that check also needed one deepcopy line for the new pointer field, which is included. I haven't run this against a live Fluent Bit.Fixes #1618