Search: Remove history query (#99026)

This commit is contained in:
Ryan McKinley
2025-01-15 12:49:47 -06:00
committed by GitHub
parent f9f341e9c9
commit cd46f1ddb9
16 changed files with 1115 additions and 1701 deletions
@@ -42,11 +42,6 @@ func (d *directResourceClient) GetStats(ctx context.Context, in *resource.Resour
return d.server.GetStats(ctx, in)
}
// History implements ResourceClient.
func (d *directResourceClient) History(ctx context.Context, in *resource.HistoryRequest, opts ...grpc.CallOption) (*resource.HistoryResponse, error) {
return d.server.History(ctx, in)
}
// IsHealthy implements ResourceClient.
func (d *directResourceClient) IsHealthy(ctx context.Context, in *resource.HealthCheckRequest, opts ...grpc.CallOption) (*resource.HealthCheckResponse, error) {
return d.server.IsHealthy(ctx, in)
@@ -7,8 +7,6 @@ import (
"net/http"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/grafana/authlib/claims"
"github.com/grafana/grafana/pkg/apimachinery/utils"
dashboard "github.com/grafana/grafana/pkg/apis/dashboard"
@@ -251,6 +249,7 @@ func (a *dashboardSqlAccess) Search(ctx context.Context, req *resource.ResourceS
return nil, fmt.Errorf("not yet (filter)")
}
/**
func (a *dashboardSqlAccess) History(ctx context.Context, req *resource.HistoryRequest) (*resource.HistoryResponse, error) {
info, err := claims.ParseNamespace(req.Key.Namespace)
if err == nil {
@@ -329,6 +328,7 @@ func (a *dashboardSqlAccess) History(ctx context.Context, req *resource.HistoryR
}
return list, err
}
**/
func (a *dashboardSqlAccess) ListRepositoryObjects(ctx context.Context, req *resource.ListRepositoryObjectsRequest) (*resource.ListRepositoryObjectsResponse, error) {
return nil, fmt.Errorf("not implemented")
@@ -2,7 +2,6 @@ package v0alpha1
import (
"context"
"errors"
"fmt"
"github.com/prometheus/client_golang/prometheus"
@@ -146,14 +145,6 @@ func (b *DashboardsAPIBuilder) UpdateAPIGroupInfo(apiGroupInfo *genericapiserver
storage := map[string]rest.Storage{}
storage[dash.StoragePath()] = legacyStore
storage[dash.StoragePath("history")] = apistore.NewHistoryConnector(
b.legacy.Server, // as client???
dashboardv0alpha1.DashboardResourceInfo.GroupResource(),
)
if optsGetter == nil {
return errors.New("missing RESTOptionsGetter")
}
// Dual writes if a RESTOptionsGetter is provided
if dualWriteBuilder != nil {
@@ -142,13 +142,9 @@ func (b *DashboardsAPIBuilder) UpdateAPIGroupInfo(apiGroupInfo *genericapiserver
storage := map[string]rest.Storage{}
storage[dash.StoragePath()] = legacyStore
storage[dash.StoragePath("history")] = apistore.NewHistoryConnector(
b.legacy.Server, // as client???
dashboardv1alpha1.DashboardResourceInfo.GroupResource(),
)
// Dual writes if a RESTOptionsGetter is provided
if optsGetter != nil && dualWriteBuilder != nil {
if dualWriteBuilder != nil {
store, err := grafanaregistry.NewRegistryStore(scheme, dash, optsGetter)
if err != nil {
return err
@@ -143,13 +143,9 @@ func (b *DashboardsAPIBuilder) UpdateAPIGroupInfo(apiGroupInfo *genericapiserver
storage := map[string]rest.Storage{}
storage[dash.StoragePath()] = legacyStore
storage[dash.StoragePath("history")] = apistore.NewHistoryConnector(
b.legacy.Server, // as client???
dashboardv2alpha1.DashboardResourceInfo.GroupResource(),
)
// Dual writes if a RESTOptionsGetter is provided
if optsGetter != nil && dualWriteBuilder != nil {
if dualWriteBuilder != nil {
store, err := grafanaregistry.NewRegistryStore(scheme, dash, optsGetter)
if err != nil {
return err