INNER CODE UNIT · Go
func
grafana/grafana-operator · controllers/alertrulegroup_controller.go:61
func (r *GrafanaAlertRuleGroupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := logf.FromContext(ctx).WithName("GrafanaAlertRuleGroupReconciler")
ctx = logf.IntoContext(ctx, log)
cr := &v1beta1.GrafanaAlertRuleGroup{}
err := r.Get(ctx, req.NamespacedName, cr)
if err != nil {
if apierrors.IsNotFound(err) {
return ctrl.Result{}, nil
}
log.Error(err, LogMsgGettingCR)
return ctrl.Result{}, fmt.Errorf("%s: %w", LogMsgGettingCR, err)
}
if cr.GetDeletionTimestamp() != nil {