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
This commit is contained in:
Daniele Stefano Ferru
2025-09-11 13:27:25 +02:00
committed by GitHub
parent ab3c93b279
commit 083c6ee019
+6
View File
@@ -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()