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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user