From 083c6ee0199050e6f85683df3d2e532d735671c4 Mon Sep 17 00:00:00 2001 From: Daniele Stefano Ferru Date: Thu, 11 Sep 2025 13:27:25 +0200 Subject: [PATCH] Dashboard: skip deletion validation on standalone mode (#110938) * Dashboard: skip deletion validation on standalone mode * move dashboard check right before provisioning service is used * use isInterfaceNil --- pkg/registry/apis/dashboard/register.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/registry/apis/dashboard/register.go b/pkg/registry/apis/dashboard/register.go index 08cf99809cf..f7602d61d1d 100644 --- a/pkg/registry/apis/dashboard/register.go +++ b/pkg/registry/apis/dashboard/register.go @@ -58,6 +58,7 @@ import ( "github.com/grafana/grafana/pkg/storage/legacysql/dualwrite" "github.com/grafana/grafana/pkg/storage/unified/apistore" "github.com/grafana/grafana/pkg/storage/unified/resource" + "github.com/grafana/grafana/pkg/util" ) var ( @@ -279,6 +280,11 @@ func (b *DashboardsAPIBuilder) validateDelete(ctx context.Context, a admission.A return fmt.Errorf("%v: %w", "failed to parse namespace", err) } + // HACK: deletion validation currently doesn't work for the standalone case. So we currently skip it. + if b.isStandalone && util.IsInterfaceNil(b.dashboardProvisioningService) { + return nil + } + // The name of the resource is the dashboard UID dashboardUID := a.GetName()