Detect external bootc status changes via fsnotify (milestone 4d)#59
Open
alicefr wants to merge 6 commits into
Open
Detect external bootc status changes via fsnotify (milestone 4d)#59alicefr wants to merge 6 commits into
alicefr wants to merge 6 commits into
Conversation
8021bcf to
74c721d
Compare
069de0b to
55db9c1
Compare
jlebon
reviewed
Jun 24, 2026
910af27 to
d52771b
Compare
Add a StatusWatcher component that detects external bootc status changes via fsnotify on /proc/1/root/ostree/bootc (with fallback to /proc/1/root/sysroot/state/deploy for composefs), plus a configurable polling interval as a safety net. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Alice Frosi <afrosi@redhat.com>
Turn the StatusWatcher into an informer-style cache for bootc status. The watcher owns the Executor, refreshes the cached *bootc.Status on fsnotify/poll events, and exposes GetStatus() for consumers. Polling only activates after fsnotify fails. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Alice Frosi <afrosi@redhat.com>
Test warm cache, cold cache, poll deferral, and refactor existing tests to use a shared newTestWatcher helper. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Alice Frosi <afrosi@redhat.com>
The reconciler reads bootc status from the watcher's cache via GetStatus() instead of shelling out on every reconcile. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Alice Frosi <afrosi@redhat.com>
Each unit test creates its own watcher with a fresh cache via newTestEnv() to avoid test pollution. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Alice Frosi <afrosi@redhat.com>
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Alice Frosi <afrosi@redhat.com>
Collaborator
Author
|
Implemented the caching mechanism suggested by #59 (comment) mostly included in commit: 48032ff |
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.
Bootc changes are detected via fsnotify or via a polling mechanism.
This is built on top of #50