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.
github.com/fsnotify/fsnotify uses ionotify as the mechanism to detect for changes in the watched file system.
Within sandboxed or restricted environment contexts (such as gVisor), certain system calls may be prohibited under some specific scenarios.
This means that currently the
fluent-bit-watcher
component cannot be used in sandboxed environment properly. The changes to the underlying Fluent Bit config file (mounted from thefluentbit-operator
secret) will not be detected properly, and fluent bit process will not be restarted when changes occur.One approach to work around such issue is to watch files utilizing stat polling. Ideally fsnotify will support polling. There is an existing long standing issue open, that has some discussion and links to possible implementations. One such implementation has recently been added to hugo.
This PR brings in the identical implementation added in hugo. A new
filenotify
package is introduced from hugo/watch/filenotify.We could use
hugo/watch/filenotify
package directly, however this brings in the whole ofgithub.aaakk.us.kg/gohugoio/hugo
as a go package dependency which is less than ideal for such a small addition.Ideally we can remove this in future if and when poll support lands in fsnotify.
Tested that polling solution works under gVisor, and that non-polling solution works in containerd as expected.
Additional changes:
Dockerfile
to build from all of source codeargs
support toFluentBit
CRD