mirror of
https://github.com/grafana/grafana.git
synced 2026-08-19 01:34:54 -05:00
APIServer: Add Method for Installer-Based Apps to Self-Register with the APIRegistrar (#112479)
* [APIServer] Add the method RegisterAPIInstaller to the APIRegistrar interface, and implement it in the builder. This allows new installer-based apps to register themselves in enterprise. * Rename RegisterAPIInstaller to RegisterAppInstaller
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"k8s.io/kube-openapi/pkg/common"
|
||||
"k8s.io/kube-openapi/pkg/spec3"
|
||||
|
||||
appsdkapiserver "github.com/grafana/grafana-app-sdk/k8s/apiserver"
|
||||
grafanarest "github.com/grafana/grafana/pkg/apiserver/rest"
|
||||
"github.com/grafana/grafana/pkg/services/apiserver/options"
|
||||
"github.com/grafana/grafana/pkg/storage/unified/apistore"
|
||||
@@ -113,6 +114,7 @@ type APIRoutes struct {
|
||||
|
||||
type APIRegistrar interface {
|
||||
RegisterAPI(builder APIGroupBuilder)
|
||||
RegisterAppInstaller(installer appsdkapiserver.AppInstaller)
|
||||
}
|
||||
|
||||
func getGroup(builder APIGroupBuilder) (string, error) {
|
||||
|
||||
@@ -248,6 +248,10 @@ func (s *service) RegisterAPI(b builder.APIGroupBuilder) {
|
||||
s.builders = append(s.builders, b)
|
||||
}
|
||||
|
||||
func (s *service) RegisterAppInstaller(i appsdkapiserver.AppInstaller) {
|
||||
s.appInstallers = append(s.appInstallers, i)
|
||||
}
|
||||
|
||||
// nolint:gocyclo
|
||||
func (s *service) start(ctx context.Context) error {
|
||||
// Get the list of groups the server will support
|
||||
|
||||
Reference in New Issue
Block a user