diff --git a/controllers/dashboard_controller.go b/controllers/dashboard_controller.go index 48ce16eee..efb091918 100644 --- a/controllers/dashboard_controller.go +++ b/controllers/dashboard_controller.go @@ -305,10 +305,14 @@ func (r *GrafanaDashboardReconciler) onDashboardDeleted(ctx context.Context, nam resp, err := grafanaClient.Dashboards.GetDashboardByUID(*uid) if err != nil { var notFound *dashboards.GetDashboardByUIDNotFound - if !errors.As(err, ¬Found) { - return err + if errors.As(err, ¬Found) { + // nothing to do if the dashboard doesn't exist + return nil } + + return err } + dash := resp.GetPayload() _, err = grafanaClient.Dashboards.DeleteDashboardByUID(*uid) //nolint:errcheck