feat: Add investigations app backend (#98084)
* add initial structure for investigations app backedn * update version * Fix codegen & paths Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * Fix Go workspace and CODEOWNERS Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> * update kinds for investigation * update dockerfile * update codeowners * update dependabot * update golangci * add investigation app and watcher * run make update-workspace * run make update-workspace * register investigation app * add investigation app to wireset * add investigations app provider to api initializer * fix imports * update feature toggle * fix cue definition and api initializer * clean up removing unecessary components * remove watcher feature toggle * add investigations backend behind feature toggle * revert change --------- Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com> Co-authored-by: Igor Suleymanov <igor.suleymanov@grafana.com>
This commit is contained in:
co-authored by
Igor Suleymanov
parent
e8b6d43110
commit
f46c07aba7
@@ -5,10 +5,12 @@ import (
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/registry"
|
||||
"github.com/grafana/grafana/pkg/registry/apps/investigation"
|
||||
"github.com/grafana/grafana/pkg/registry/apps/playlist"
|
||||
"github.com/grafana/grafana/pkg/services/apiserver"
|
||||
"github.com/grafana/grafana/pkg/services/apiserver/builder"
|
||||
"github.com/grafana/grafana/pkg/services/apiserver/builder/runner"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -25,7 +27,9 @@ type Service struct {
|
||||
func ProvideRegistryServiceSink(
|
||||
registrar builder.APIRegistrar,
|
||||
restConfigProvider apiserver.RestConfigProvider,
|
||||
features featuremgmt.FeatureToggles,
|
||||
playlistAppProvider *playlist.PlaylistAppProvider,
|
||||
investigationAppProvider *investigation.InvestigationAppProvider,
|
||||
) (*Service, error) {
|
||||
cfgWrapper := func(ctx context.Context) *rest.Config {
|
||||
cfg := restConfigProvider.GetRestConfig(ctx)
|
||||
@@ -40,11 +44,19 @@ func ProvideRegistryServiceSink(
|
||||
RestConfigGetter: cfgWrapper,
|
||||
APIRegistrar: registrar,
|
||||
}
|
||||
runner, err := runner.NewAPIGroupRunner(cfg, playlistAppProvider)
|
||||
|
||||
var apiGroupRunner *runner.APIGroupRunner
|
||||
var err error
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagInvestigationsBackend) {
|
||||
apiGroupRunner, err = runner.NewAPIGroupRunner(cfg, playlistAppProvider, investigationAppProvider)
|
||||
} else {
|
||||
apiGroupRunner, err = runner.NewAPIGroupRunner(cfg, playlistAppProvider)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Service{runner: runner, log: log.New("app-registry")}, nil
|
||||
return &Service{runner: apiGroupRunner, log: log.New("app-registry")}, nil
|
||||
}
|
||||
|
||||
func (s *Service) Run(ctx context.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user