DualWrite: Cleanup and centralize the dual write creation (#90013)

This commit is contained in:
Ryan McKinley
2024-07-11 23:23:31 +03:00
committed by GitHub
parent 4b5b599982
commit d2bc4f3255
22 changed files with 125 additions and 150 deletions
+1 -7
View File
@@ -156,11 +156,6 @@ func (b *DataSourceAPIBuilder) GetGroupVersion() schema.GroupVersion {
return b.connectionResourceInfo.GroupVersion()
}
func (b *DataSourceAPIBuilder) GetDesiredDualWriterMode(dualWrite bool, modeMap map[string]grafanarest.DualWriterMode) grafanarest.DualWriterMode {
// Add required configuration support in order to enable other modes. For an example, see pkg/registry/apis/playlist/register.go
return grafanarest.Mode0
}
func addKnownTypes(scheme *runtime.Scheme, gv schema.GroupVersion) {
scheme.AddKnownTypes(gv,
&datasource.DataSourceConnection{},
@@ -208,8 +203,7 @@ func (b *DataSourceAPIBuilder) GetAPIGroupInfo(
scheme *runtime.Scheme,
codecs serializer.CodecFactory, // pointer?
_ generic.RESTOptionsGetter,
_ grafanarest.DualWriterMode,
_ prometheus.Registerer,
_ grafanarest.DualWriteBuilder,
) (*genericapiserver.APIGroupInfo, error) {
storage := map[string]rest.Storage{}