-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
volumeMounted configmap does not trigger bundle watch events #2588
Comments
@drewwells Are you updating the a file(s) in |
Watching files only works in situations where standard files are in use. In k8s, configmaps are mounted via a set of symlinks. In those situations, you will only get file events when watching the directory containing the symlink. Since by default, configmaps are mounted as directories, I don't expect many people to find regressions when using this. Signed-off-by: Drew Wells <drew.wells00@gmail.com>
@ashutosh-narkar That's right. Kubelet uses symlinks to point to the most recent version of a volume mount. As a result, it does not necessarily trigger the file events that fsnotify expects. I have updated the file watcher to instead watch the directories. We use this internally and it has been working well. My PR fixing this is here #2589 I'm not able to re-open the PR, but the tests are now working. |
Watching files only works in situations where standard files are in use. In k8s, configmaps are mounted via a set of symlinks. In those situations, you will only get file events when watching the directory containing the symlink. Fixes open-policy-agent#2588 Signed-off-by: Drew Wells <drew.wells00@gmail.com>
Watching files only works in situations where standard files are in use. In k8s, configmaps are mounted via a set of symlinks. In those situations, you will only get file events when watching the directory containing the symlink. Fixes #2588 Signed-off-by: Drew Wells <drew.wells00@gmail.com>
Expected Behavior
A volume mounted configmap would trigger a filewatch event in opa.
Actual Behavior
The configmap symlink points to an updated file, but no event is registered in OPA.
Steps to Reproduce the Problem
Create a pod with opa in it. Create a configmap with a bundle tarball
Start opa with
opa run -s -b -w /volumePath/bundle.tar.gz
Update the configmap somehow
Check the opa logs for file watch events
We use 0.18.0, but 0.22.0 showed the same issues
Additional Info
I've seen other projects that claim support for mounted configmap file watch events. linkerd/linkerd2#1061 It should be possible to watch the symlink and see file events for symlink changes.
The text was updated successfully, but these errors were encountered: