K8s: Add App SDK installer (#107773)

This commit is contained in:
Todd Treece
2025-07-21 13:32:15 -04:00
committed by GitHub
parent 548964f728
commit e5d2f92384
107 changed files with 2772 additions and 1891 deletions
+13 -4
View File
@@ -5,6 +5,7 @@ import (
"slices"
"github.com/grafana/grafana-app-sdk/app"
appsdkapiserver "github.com/grafana/grafana-app-sdk/k8s/apiserver"
"k8s.io/client-go/rest"
"github.com/grafana/grafana/pkg/infra/log"
@@ -20,6 +21,14 @@ import (
"github.com/grafana/grafana/pkg/setting"
)
// ProvideAppInstallers returns a list of app installers that can be used to install apps.
// This is the pattern that should be used to provide app installers in the app registry.
func ProvideAppInstallers(
playlistAppInstaller *playlist.PlaylistAppInstaller,
) []appsdkapiserver.AppInstaller {
return []appsdkapiserver.AppInstaller{playlistAppInstaller}
}
var (
_ registry.BackgroundService = (*Service)(nil)
)
@@ -29,12 +38,12 @@ type Service struct {
log log.Logger
}
// ProvideRegistryServiceSink is an entry point for each service that will force initialization
func ProvideRegistryServiceSink(
// ProvideBuilderRunners adapts apps to the APIGroupBuilder interface.
// deprecated: Use ProvideAppInstallers instead.
func ProvideBuilderRunners(
registrar builder.APIRegistrar,
restConfigProvider apiserver.RestConfigProvider,
features featuremgmt.FeatureToggles,
playlistAppProvider *playlist.PlaylistAppProvider,
investigationAppProvider *investigations.InvestigationsAppProvider,
advisorAppProvider *advisor.AdvisorAppProvider,
alertingNotificationsAppProvider *notifications.AlertingNotificationsAppProvider,
@@ -56,7 +65,7 @@ func ProvideRegistryServiceSink(
logger := log.New("app-registry")
var apiGroupRunner *runner.APIGroupRunner
var err error
providers := []app.Provider{playlistAppProvider}
providers := []app.Provider{}
if features.IsEnabledGlobally(featuremgmt.FlagInvestigationsBackend) {
logger.Debug("Investigations backend is enabled")
providers = append(providers, investigationAppProvider)