Skip to content

Commit

Permalink
Update grafananotificationchannel_controller.go (#751)
Browse files Browse the repository at this point in the history
Fix: [Bug] GrafanaNotificationChannel cr not have UID will cause the program to crash #747
  • Loading branch information
gxg001 committed May 13, 2022
1 parent 8133495 commit 2cde511
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -276,7 +276,10 @@ func (r *GrafanaNotificationChannelReconciler) reconcileNotificationChannels(req
if err := json.Unmarshal(processed, &rawJson); err != nil {
return reconcile.Result{}, err
}

if rawJson.UID == nil {
r.Log.Info(fmt.Sprintf("cannot process notificationchannel %v/%v, UID is nil", notificationchannel.Namespace, notificationchannel.Name))
return reconcile.Result{}, nil
}
if _, err = client.GetNotificationChannel(*rawJson.UID); err != nil {
status, err = client.CreateNotificationChannel(processed)
} else {
Expand Down

0 comments on commit 2cde511

Please sign in to comment.