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

Set status.cond when cluster secret not found #633

Merged
merged 1 commit into from
Jun 9, 2023
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
10 changes: 10 additions & 0 deletions controllers/topology_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,17 @@ func (r *TopologyReconciler) handleRMQReferenceParseError(ctx context.Context, o
}
return ctrl.Result{}, nil
}

// set status condition and publish event for any other error
logger.Error(err, failedParseClusterRef)
msg := fmt.Sprintf("%s: %s", failedParseClusterRef, err.Error())
r.Recorder.Event(object, corev1.EventTypeWarning, "FailedCreateOrUpdate", msg)
Copy link
Member

Choose a reason for hiding this comment

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

Just FTR, I wanted to suggest using a "type error" here but apparently there only "normal" and "warning" to choose from in the API :)

object.SetStatusConditions([]topology.Condition{topology.NotReady(msg, r.getStatusConditions(object))})
if writerErr := clientretry.RetryOnConflict(clientretry.DefaultRetry, func() error {
return r.Status().Update(ctx, object)
}); writerErr != nil {
logger.Error(writerErr, failedStatusUpdate, "object", object.GetName())
}
return ctrl.Result{}, err
}

Expand Down