Skip to content
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

Backport Fix status conflict between agent and fleetcontroller [SURE-9104] #3002

Closed
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,15 @@ func (r *BundleDeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Req
State: string(summary.GetDeploymentState(bd)),
}

var t *fleet.BundleDeployment
err = retry.RetryOnConflict(retry.DefaultRetry, func() error {
t = &fleet.BundleDeployment{}
err := r.Get(ctx, req.NamespacedName, t)
if err != nil {
return err
}
t.Status = bd.Status
return r.Status().Update(ctx, t)
})
err = r.Status().Update(ctx, bd)
if err != nil {
logger.V(1).Error(err, "Reconcile failed final update to bundle deployment status", "status", bd.Status)
} else {
metrics.BundleDeploymentCollector.Collect(ctx, t)
logger.V(1).Error(err, "Reconcile failed update to bundle deployment status, requeueing", "status", bd.Status)
return ctrl.Result{}, err
}

return ctrl.Result{}, err
metrics.BundleDeploymentCollector.Collect(ctx, bd)

return ctrl.Result{}, nil
}

// bundleDeploymentStatusChangedPredicate returns true if the bundledeployment
Expand Down
Loading