Skip to content

Detect external bootc status changes via fsnotify (milestone 4d)#59

Open
alicefr wants to merge 13 commits into
bootc-dev:mainfrom
alicefr:milestone-4d
Open

Detect external bootc status changes via fsnotify (milestone 4d)#59
alicefr wants to merge 13 commits into
bootc-dev:mainfrom
alicefr:milestone-4d

Conversation

@alicefr

@alicefr alicefr commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Bootc changes are detected via fsnotify or via a polling mechanism.

This is built on top of #50

@alicefr alicefr force-pushed the milestone-4d branch 2 times, most recently from 8c4bb61 to 235cff4 Compare June 11, 2026 09:57
alicefr added 11 commits June 12, 2026 08:19
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Seed the bink registry with the bootc image from the node disk image
so e2e tests can reference real images. Add --target-imgref support
to make nodes track the registry image.

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verify that the BootcNode booted image and digest match the seeded
registry image when available.

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move the update image build logic out of e2e test code and into a
Makefile target. Build the update image as part of deploy-bink so it
is available for both manual testing and e2e tests.

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Alice Frosi <afrosi@redhat.com>
Rewrite the reconciler to detect image mismatches between
spec.desiredImage and the booted image, stage via bootc switch in a
background goroutine.

Once, it finished to staged the image, the termination of the
goroutine triggers once more the reconciliation loop which will detect
that the system requires a reboot.

The reconciliation function ensures that the bootc node transitions from
Staging to Staged, and then to Rebooting.

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Alice Frosi <afrosi@redhat.com>
Replace raw JSON bytes with a bootc.Status struct in the test fake.
Status() serializes the struct via json.Marshal, and Switch()
auto-mutates the status (staging sets Staged). Upgrade() records the
call for test assertions.

Add newBootcStatus() and newBootEntry() helpers to build test state
without verbose JSON constants.

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Alice Frosi <afrosi@redhat.com>
Add envtest cases for the daemon reconciler state machine:

- TestStagingTriggered: image mismatch triggers bootc switch
- TestStagingError: switch failure sets Degraded condition
- TestAlreadyStaged: skip switch when image already staged
- TestRebootingSet: reboot triggered when desiredImageState is Booted
- TestRollback: restage when desired image changes
- TestCancelInflightSwitch: spec change cancels in-flight switch

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>
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
alicefr added 2 commits June 12, 2026 13:41
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>
Add --poll-interval flag to the daemon binary and wire the
StatusWatcher channel into the reconciler as a second
WatchesRawSource alongside switchDone.

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Alice Frosi <afrosi@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant