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()