chore: refactor SecretMigrationProviderImpl as a dskit module (#71944)

* chore: refactor SecretMigrationProviderImpl as a dskit service
This commit is contained in:
Kristin Laemmert
2023-07-24 08:14:53 -04:00
committed by GitHub
parent 987624f8cf
commit 76abbef32d
4 changed files with 32 additions and 18 deletions
+6 -4
View File
@@ -13,14 +13,16 @@ const (
HTTPServer string = "http-server"
// Provisioning sets up Grafana with preconfigured datasources, dashboards, etc.
Provisioning string = "provisioning"
// SecretMigrator handles legacy secrets migrations
SecretMigrator string = "secret-migrator"
)
// dependencyMap defines Module Targets => Dependencies
var dependencyMap = map[string][]string{
BackgroundServices: {Provisioning, HTTPServer},
CertGenerator: {},
GrafanaAPIServer: {CertGenerator},
Provisioning: {SecretMigrator},
CertGenerator: {},
GrafanaAPIServer: {CertGenerator},
All: {Provisioning, HTTPServer, BackgroundServices},
All: {BackgroundServices},
}
+3
View File
@@ -10,6 +10,7 @@ import (
"github.com/grafana/grafana/pkg/server/backgroundsvcs"
grafanaapiserver "github.com/grafana/grafana/pkg/services/grafana-apiserver"
"github.com/grafana/grafana/pkg/services/provisioning"
"github.com/grafana/grafana/pkg/services/secrets/kvstore/migrations"
)
type Registry interface{}
@@ -26,6 +27,7 @@ func ProvideRegistry(
certGenerator certgenerator.ServiceInterface,
httpServer *api.HTTPServer,
provisioningService *provisioning.ProvisioningServiceImpl,
secretsMigrator *migrations.SecretMigrationProviderImpl,
) *registry {
return newRegistry(
log.New("modules.registry"),
@@ -35,6 +37,7 @@ func ProvideRegistry(
certGenerator,
httpServer,
provisioningService,
secretsMigrator,
)
}