Skip to content

OCPBUGS-52656: Update the MCN PIS status of only the primary pool #4948

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

Merged
merged 1 commit into from
Apr 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions pkg/daemon/pinned_image_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,31 +220,37 @@ func (p *PinnedImageSetManager) sync(key string) error {
return nil
}

primaryPool, err := helpers.GetPrimaryPoolForNode(p.mcpLister, node)
if err != nil {
klog.Errorf("error getting primary pool for node: %v", node.Name)
return err
}

Comment on lines +223 to +228
Copy link
Member

Choose a reason for hiding this comment

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

Question: Since this is is being added to replace the previous get pool functionality, are you able to remove the pool selection code up here?

Suggestion: Since GetPrimaryPoolForNode can return nil, nil (no pool, but also no error), it might be good to add a check to make sure you do get a pool (like the check here).

Copy link
Contributor Author

@RishabhSaini RishabhSaini Mar 26, 2025

Choose a reason for hiding this comment

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

Question: Since this is is being added to replace the previous get pool functionality, are you able to remove the pool selection code up here?

We still want to sync the individual pools of the node. Just not update the status as it duplicates

Suggestion: Since GetPrimaryPoolForNode can return nil, nil (no pool, but also no error), it might be good to add a check to make sure you do get a pool (like the check here).

agreed

Copy link
Member

Choose a reason for hiding this comment

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

We still want to sync the individual pools of the node. Just not update the status as it duplicates

Understood, thanks!

ctx, cancel := context.WithTimeout(context.Background(), p.prefetchTimeout)
// cancel any currently running tasks in the worker pool
p.resetWorkload(cancel)
if err := p.updateStatusProgressing(pools); err != nil {
if err := p.updateStatusProgressing([]*mcfgv1.MachineConfigPool{primaryPool}); err != nil {
klog.Errorf("failed to update status: %v", err)
}

if err := p.syncMachineConfigPools(ctx, pools); err != nil {
if errors.Is(err, context.DeadlineExceeded) {
ctxErr := fmt.Errorf("%w: %v", errRequeueAfterTimeout, p.prefetchTimeout)
if err := p.updateStatusError(pools, ctxErr); err != nil {
if err := p.updateStatusError([]*mcfgv1.MachineConfigPool{primaryPool}, ctxErr); err != nil {
klog.Errorf("failed to update status: %v", err)
}
klog.Info(ctxErr)
return ctxErr
}

klog.Error(err)
if err := p.updateStatusError(pools, err); err != nil {
if err := p.updateStatusError([]*mcfgv1.MachineConfigPool{primaryPool}, err); err != nil {
klog.Errorf("failed to update status: %v", err)
}
return err
}

return p.updateStatusProgressingComplete(pools, "All pinned image sets complete")
return p.updateStatusProgressingComplete([]*mcfgv1.MachineConfigPool{primaryPool}, "All pinned image sets complete")
}

func (p *PinnedImageSetManager) syncMachineConfigPools(ctx context.Context, pools []*mcfgv1.MachineConfigPool) error {
Expand Down