Skip to content
Open
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 @@ -62,6 +62,9 @@ import (
const (
openshiftFinalizer = "foreground-deletion"
hypershiftFinalizer = "hypershift.openshift.io/foreground-deletion"

// statusUpdateRequeueAfter is the delay before retrying reconcile after a failure to update performance profile status.
statusUpdateRequeueAfter = 30 * time.Second
)

// PerformanceProfileReconciler reconciles a PerformanceProfile object
Expand Down Expand Up @@ -615,13 +618,14 @@ func (r *PerformanceProfileReconciler) Reconcile(ctx context.Context, req ctrl.R
conditions := status.GetDegradedConditions(status.ConditionReasonComponentsCreationFailed, err.Error())
if err := r.StatusWriter.Update(ctx, instance, conditions); err != nil {
klog.Errorf("failed to update performance profile %q status: %v", instance.GetName(), err)
return reconcile.Result{}, err
return reconcile.Result{RequeueAfter: statusUpdateRequeueAfter}, nil
}
return reconcile.Result{}, err
}
err = r.StatusWriter.UpdateOwnedConditions(ctx, instance)
if err != nil {
klog.Errorf("failed to update performance profile %q status: %v", instance.GetName(), err)
return ctrl.Result{RequeueAfter: statusUpdateRequeueAfter}, nil
}
return ctrl.Result{}, nil
}
Expand Down Expand Up @@ -651,7 +655,7 @@ func (r *PerformanceProfileReconciler) getAndValidateMCP(ctx context.Context, in
conditions := status.GetDegradedConditions(status.ConditionFailedToFindMachineConfigPool, err.Error())
if err := r.StatusWriter.Update(ctx, profile, conditions); err != nil {
klog.Errorf("failed to update performance profile %q status: %v", profile.GetName(), err)
return nil, &reconcile.Result{}, err
return nil, &reconcile.Result{RequeueAfter: statusUpdateRequeueAfter}, nil
}
return nil, &reconcile.Result{}, nil
}
Expand All @@ -660,7 +664,7 @@ func (r *PerformanceProfileReconciler) getAndValidateMCP(ctx context.Context, in
conditions := status.GetDegradedConditions(status.ConditionBadMachineConfigLabels, err.Error())
if err := r.StatusWriter.Update(ctx, profile, conditions); err != nil {
klog.Errorf("failed to update performance profile %q status: %v", profile.GetName(), err)
return nil, &reconcile.Result{}, err
return nil, &reconcile.Result{RequeueAfter: statusUpdateRequeueAfter}, nil
}
return nil, &reconcile.Result{}, nil
}
Expand Down