mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
Secrets: Add logging to track secrets migration (#52481)
* add logging to track migration * fix lint problem
This commit is contained in:
parent
20907d0635
commit
acd85314b3
@ -41,6 +41,7 @@ func (s *PluginSecretMigrationService) Migrate(ctx context.Context) error {
|
||||
// Check if we should migrate to plugin - default false
|
||||
if s.cfg.SectionWithEnvOverrides("secrets").Key("migrate_to_plugin").MustBool(false) &&
|
||||
s.remoteCheck.ShouldUseRemoteSecretsPlugin() {
|
||||
s.logger.Debug("starting migration of unified secrets to the plugin")
|
||||
// we need to instantiate the secretsKVStore as this is not on wire, and in this scenario,
|
||||
// the secrets store would be the plugin.
|
||||
secretsSql := &secretsKVStoreSQL{
|
||||
@ -63,6 +64,7 @@ func (s *PluginSecretMigrationService) Migrate(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
s.logger.Debug("migrated unified secrets to plugin", "number of secrets", len(allSec))
|
||||
// as no err was returned, when we delete all the secrets from the sql store
|
||||
for _, sec := range allSec {
|
||||
err = secretsSql.Del(ctx, *sec.OrgId, *sec.Namespace, *sec.Type)
|
||||
@ -70,6 +72,7 @@ func (s *PluginSecretMigrationService) Migrate(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
s.logger.Debug("deleted unified secrets after migration", "number of secrets", len(allSec))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user