Prep patches for rollout state machine#49
Merged
Merged
Conversation
Was investigating something else and came upon this old issue in the MCO repo. It has a lot of interesting info about etcd and rollout ordering which I think will be helpful once we tackle cross-pool ordering. So link to it.
Add a new bootc.dev/in-reboot-slot annotation to persistently track which nodes occupy a reboot slot. This is needed to make sure that slot counting survives controller restarts. The annotation is set when a slot is assigned and removed when freed. Both in-reboot-slot and was-cordoned are placed on the BootcNode rather than the K8s Node. The reconciler already has all owned BootcNodes in hand during driveRollout. Keeping operator bookkeeping off the Node object also avoids unnecessary churn on an object that other controllers and tools may be watching. Assisted-by: Pi (Claude Opus 4.6)
This updates the code to match the architecture change in the previous commit where we moved the was-cordoned annotation from the Node to the BootcNode. Assisted-by: Pi (Claude Opus 4.6)
Move driveRollout(), nodeState enum, classifyNode(), and TestClassifyNode to dedicated rollout.go and rollout_test.go files. The controller file is already ~500 lines and the upcoming rollout state machine commits will add substantially more. Separating now keeps the split clean: bootcnodepool_controller.go owns Reconcile(), watches, and membership sync; rollout.go owns the rollout state machine. Pure code move, no behavioral changes. Assisted-by: Pi (Claude Opus 4.6)
alicefr
reviewed
Jun 3, 2026
alicefr
approved these changes
Jun 3, 2026
Add rolloutState struct to classify owned BootcNodes into state buckets and count occupied reboot slots from the in-reboot-slot annotation. Add resolveMaxUnavailable to compute effective maxUnavailable from the pool spec (defaults to 1, rounds up for percentages, returns 0 when paused). Add selectDrainCandidates to pick Staged nodes needing the drain flow, always re-selecting already-slotted nodes regardless of capacity. driveRollout now computes slots and candidates but does not yet act on them. Also adds testutil node builder options (WithBootedDigest, WithNodeCondition, WithNodeAnnotation) used across rollout tests. Assisted-by: Pi (Claude Opus 4.6)
Collaborator
Author
|
Updated for comments! They're minor changes so will merge based on approval. |
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.
Move reboot slot annotations to BootcNode, split rollout code into its own file, and add reboot slot tracking with candidate selection. No transitions yet, just classifying and selecting.
See individual commits for more details.