Skip to content

Commit

Permalink
Merge pull request #187 from mshitrit/last-error-fix
Browse files Browse the repository at this point in the history
Last error not recorded for missing node
  • Loading branch information
openshift-merge-bot[bot] committed Feb 5, 2024
2 parents 796fef2 + 2e2fbbb commit a264e8a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions controllers/selfnoderemediation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,14 @@ func (r *SelfNodeRemediationReconciler) Reconcile(ctx context.Context, req ctrl.
if err != nil {
if apiErrors.IsNotFound(err) {
r.logger.Info("couldn't find node matching remediation", "node name", snr.Name)
if err = r.updateConditions(remediationSkippedNodeNotFound, snr); err != nil {
return ctrl.Result{}, err
if updateErr := r.updateConditions(remediationSkippedNodeNotFound, snr); updateErr != nil {
return ctrl.Result{}, updateErr
}
events.NormalEvent(r.Recorder, snr, eventReasonRemediationStopped, "couldn't find node matching remediation")
return ctrl.Result{}, r.updateSnrStatusLastError(snr, err)
} else {
r.logger.Error(err, "failed to get node", "node name", snr.Name)
}
r.logger.Error(err, "failed to get node", "node name", snr.Name)
return ctrl.Result{}, err
return ctrl.Result{}, r.updateSnrStatusLastError(snr, err)
}

if node.Labels[excludeRemediationLabel] == "true" {
Expand Down

0 comments on commit a264e8a

Please sign in to comment.