Skip to content

Implementation of the pool status aggregation (milestone-3c) - #128

Open
alicefr wants to merge 11 commits into
bootc-dev:mainfrom
alicefr:milestone-3c
Open

Implementation of the pool status aggregation (milestone-3c)#128
alicefr wants to merge 11 commits into
bootc-dev:mainfrom
alicefr:milestone-3c

Conversation

@alicefr

@alicefr alicefr commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

This PR implements the pool status aggregation with the various count for the nodes in the different state.

It also introduce the ObservedGeneration, the print columns and short name for the bootc node and pool.
Fixes: #52
Fixes: #35

Refactor the function driveRollout to return the rolloutState result. In
this way, they can be used to aggregate and set the status in the pool in
the next commits.

Assisted-by: AI
Signed-off-by: Alice Frosi <afrosi@redhat.com>
@alicefr

alicefr commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author


// driveRollout is the main function that advances the rollout state machine.
func (r *BootcNodePoolReconciler) driveRollout(ctx context.Context, pool *bootcv1alpha1.BootcNodePool, ownedBootcNodes map[string]*bootcv1alpha1.BootcNode) error {
func (r *BootcNodePoolReconciler) driveRollout(ctx context.Context, pool *bootcv1alpha1.BootcNodePool, ownedBootcNodes map[string]*bootcv1alpha1.BootcNode) (*rolloutState, error) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably run go fmt throughout the project as a separate PR

@Johan-Liebert1 Johan-Liebert1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. CI lint is failing though

Comment thread internal/controller/status.go
@alicefr

alicefr commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

Need to look at the CI failure

alicefr added 7 commits August 6, 2026 10:31
Add helped functions to populate the pool status.

This commit adds also the ObservedGeneration which was missing.
Fixes: 35

Assisted-by: AI
Signed-off-by: Alice Frosi <afrosi@redhat.com>
Call the syncPoolStatus in the reconcile loop.

Assisted-by: AI
Signed-off-by: Alice Frosi <afrosi@redhat.com>
Each test sets the pool result and then calls the syncPoolStatus and
check if the pool status contains the correct values and condition.

Tests:
- TestSyncPoolStatusAllUpdated
- TestSyncPoolStatusRolloutInProgress
- TestSyncPoolStatusPaused
- TestSyncPoolStatusEmptyPool
- TestSyncPoolStatusDeployedDigestPreserved

Assisted-by: AI
Signed-off-by: Alice Frosi <afrosi@redhat.com>
Verify the status aggregation for existing e2e tests.

Assisted-by: AI
Signed-off-by: Alice Frosi <afrosi@redhat.com>
Add the coulumns: nodeCount, updatedCount, updatingCount and degradedCount.

Assisted-by: AI
Signed-off-by: Alice Frosi <afrosi@redhat.com>
Assisted-by: AI
Signed-off-by: Alice Frosi <afrosi@redhat.com>
Signed-off-by: Alice Frosi <afrosi@redhat.com>
alicefr added 2 commits August 6, 2026 13:39
The new tests added some additional delay.

Assisted-by: AI
Signed-off-by: Alice Frosi <afrosi@redhat.com>
The passt package, pulled in as a podman dependency, loads its
AppArmor profile during installation. Running aa-teardown before
apt-get install meant the profile was immediately re-loaded,
causing passt to fail with "Permission denied" when creating VMs.

Assisted-by: AI
Signed-off-by: Alice Frosi <afrosi@redhat.com>
The daemon watches its own BootcNode with For(), which fires on
all changes including status patches. When staging fails, the
reconciler sets Degraded=True and returns RequeueAfter for backoff,
but the status patch immediately re-triggers a reconcile that
bypasses the backoff and retries staging in a tight loop.

Add GenerationChangedPredicate so the For() watch only fires on
spec changes (generation increments from the pool controller).
Status patches no longer self-trigger. The daemon still reconciles
on staging completion (stageDone channel) and bootc status changes
(StatusWatcher channel).

Assisted-by: AI
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.

Add meaningful print columns for BootcNode and BootcNodePool Set ObservedGeneration on pool controller

2 participants