Revert "Revert: DataSource: Support config CRUD from apiservers (#106996) (#110342)"

This reverts commit 72eeefabd7.
This commit is contained in:
beejeebus
2025-10-07 14:31:07 -04:00
committed by beejeebus
parent 84a2f41016
commit c3f34efb41
58 changed files with 2039 additions and 471 deletions
+42
View File
@@ -0,0 +1,42 @@
package datasource
import (
"context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apiserver/pkg/registry/rest"
query "github.com/grafana/grafana/pkg/apis/query/v0alpha1"
)
// Temporary noop storage that lets us map /connections/{name}/query
type noopREST struct{}
var (
_ rest.Storage = (*noopREST)(nil)
_ rest.Scoper = (*noopREST)(nil)
_ rest.Getter = (*noopREST)(nil)
_ rest.SingularNameProvider = (*noopREST)(nil)
)
func (r *noopREST) New() runtime.Object {
return &query.QueryDataResponse{}
}
func (r *noopREST) Destroy() {}
func (r *noopREST) NamespaceScoped() bool {
return true
}
func (r *noopREST) GetSingularName() string {
return "noop"
}
func (r *noopREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {
return &metav1.Status{
Status: metav1.StatusSuccess,
Message: "noop",
}, nil
}