Unistore/datamigration: Take namespace from command line flag (#106724)

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
pull/106748/head
maicon 1 month ago committed by GitHub
parent 0034456e00
commit fcb369e9a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      pkg/cmd/grafana-cli/commands/commands.go
  2. 4
      pkg/cmd/grafana-cli/commands/datamigrations/to_unified_storage.go

@ -154,6 +154,11 @@ var adminCommands = []*cli.Command{
Usage: "Non interactive mode. Just run the migration.",
Value: false,
},
&cli.StringFlag{
Name: "namespace",
Usage: "That's the Unified Storage Namespace.",
Value: "default",
},
},
},
},

@ -32,7 +32,9 @@ import (
// ToUnifiedStorage converts dashboards+folders into unified storage
func ToUnifiedStorage(c utils.CommandLine, cfg *setting.Cfg, sqlStore db.DB) error {
namespace := "default" // TODO... from command line
// Take namespace from command line
namespace := c.String("namespace")
ns, err := authlib.ParseNamespace(namespace)
if err != nil {
return err

Loading…
Cancel
Save