Skip to content

Commit

Permalink
Merge pull request #1504 from grafana/fix-1498
Browse files Browse the repository at this point in the history
fix: do not delete non-existing dashboard
  • Loading branch information
weisdd committed Apr 23, 2024
2 parents aa532c3 + 616e2f8 commit e0d3ad8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions controllers/dashboard_controller.go
Expand Up @@ -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, &notFound) {
return err
if errors.As(err, &notFound) {
// nothing to do if the dashboard doesn't exist
return nil
}

return err
}

dash := resp.GetPayload()

_, err = grafanaClient.Dashboards.DeleteDashboardByUID(*uid) //nolint:errcheck
Expand Down

0 comments on commit e0d3ad8

Please sign in to comment.