-
Notifications
You must be signed in to change notification settings - Fork 80
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
The file backend does not update the runtime config on file change #398
Comments
Looks like it works as expected on my Fedora 39 workstation that has btrfs for a file system on
That is super weird. I am not out of inotify user watches either.
|
Just vim things.... So on my compute nodes I do most of my file editing with Here is a file edit with nano. It writes to the file as expected.
and if I use
Here is the same test with vim. It will write the changes out to a different file and then rename. You can see all the stuff it is doing in the directory when I make an edit to a file.
If we just watch the file, fsnotify records the above as a RENAME instead of a WRITE which I assume why root@8d0ad50f38c2:/go/src/fsnotify# go run ./cmd/fsnotify watch /test/joe
05:52:47.1502 ready; press ^C to exit
05:53:01.1088 1 RENAME "/test/joe" The only thing I can think of as an improvement here is to change the fsnotify watch to also reload the config if it sees a RENAME. It looks like this issue has been talked about a lot on the fsnotify GH issues page. fsnotify/fsnotify#372 talks about the problem in depth and https://github.com/fsnotify/fsnotify?tab=readme-ov-file#watching-a-file-doesnt-work-well does talk about it as well and has an example of how to better watch a file. Maybe that is worth checking out if this to be addressed in the future. I'll leave this issue open so you folks can figure out what you want to do here. I am OK with closing it since this is not really bug but a really, really, stupid edge case caused by vim or any other editor that does atomic updates to files. |
Expected Behavior
The file backend should update the runtime config with new changes when the backend-file-path file is updated.
Current Behavior
It currently does not update the runtime config as far as I can tell. Running the following command:
with the following backend-file-path
/opt/smee/example.yaml
and then I make a change and write
/opt/smee/example.yaml
it does not update the runtime config. For example I have been changing the IP address from172.16.0.29
to172.16.0.28
and the server I am testing with always gets172.16.0.29
from DHCP.The info log message https://github.com/tinkerbell/smee/blob/main/internal/backend/file/file.go#L210 never shows up in stdout.
Possible Solution
Something is dun goofed up in https://github.com/tinkerbell/smee/blob/main/internal/backend/file/file.go
Steps to Reproduce (for bugs)
See above.
Context
I am trying to automate my datacenter deployment with iPXE booting in my rack and
smee
seems pretty great for that job. In the short term I plan on using the file backend to automate imaging Fedora CoreOS servers. Long term I hope that maybe a more programmatic backend like Redis could be added to make it easier to add and remove servers that need to be iPXE booted via Smee.Your Environment
Podman and CLI for now while I test smee out for my usecase. I am going to port it to Nomad with the Podman driver if I can get things working.
The text was updated successfully, but these errors were encountered: