mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 10:49:15 +00:00
Fix returning ctrl.Result and error preventing backoff (#50)
This commit is contained in:
@@ -53,6 +53,12 @@ func (r *NBGroupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (re
|
||||
|
||||
originalGroup := nbGroup.DeepCopy()
|
||||
defer func() {
|
||||
if err != nil {
|
||||
// double check result is nil, otherwise error is not printed
|
||||
// and exponential backoff doesn't work properly
|
||||
res = ctrl.Result{}
|
||||
return
|
||||
}
|
||||
if !originalGroup.Status.Equal(nbGroup.Status) {
|
||||
updateErr := r.Client.Status().Update(ctx, &nbGroup)
|
||||
if updateErr != nil {
|
||||
|
||||
Reference in New Issue
Block a user