From 64c870f2b967ff73250b44eb995a81b0bb0c6bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Gomez?= Date: Wed, 16 Feb 2022 14:44:43 +0100 Subject: [PATCH] Do not fail dashboard deletions if the dashboard is not found --- internal/pkg/grafana/dashboards.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/pkg/grafana/dashboards.go b/internal/pkg/grafana/dashboards.go index eb55e65d..9ba48049 100644 --- a/internal/pkg/grafana/dashboards.go +++ b/internal/pkg/grafana/dashboards.go @@ -42,7 +42,12 @@ func (creator *Creator) FromRawSpec(ctx context.Context, folderName string, uid } func (creator *Creator) Delete(ctx context.Context, uid string) error { - return creator.grabanaClient.DeleteDashboard(ctx, uid) + err := creator.grabanaClient.DeleteDashboard(ctx, uid) + if err != nil && err != grabana.ErrDashboardNotFound { + return err + } + + return nil } func (creator *Creator) upsertDashboard(ctx context.Context, folderName string, dashboardBuilder dashboard.Builder) error {