diff --git a/cmd/mirror/mirror.go b/cmd/mirror/mirror.go index 69e830658a..3fbfe1ae94 100644 --- a/cmd/mirror/mirror.go +++ b/cmd/mirror/mirror.go @@ -18,7 +18,7 @@ var ( shouldReplace bool ) -func New() *cobra.Command { +func New(configFiles *[]string) *cobra.Command { cmd := &cobra.Command{ Use: "mirror", Short: "mirrors all data of ZITADEL from one database to another", @@ -37,6 +37,12 @@ Order of execution: PersistentPreRun: func(cmd *cobra.Command, args []string) { err := viper.MergeConfig(bytes.NewBuffer(defaultConfig)) logging.OnError(err).Fatal("unable to read default config") + + for _, file := range *configFiles { + viper.SetConfigFile(file) + err := viper.MergeInConfig() + logging.WithFields("file", file).OnError(err).Warn("unable to read config file") + } }, Run: func(cmd *cobra.Command, args []string) { config := mustNewMigrationConfig(viper.GetViper()) diff --git a/cmd/zitadel.go b/cmd/zitadel.go index c855dd4495..b6d6e9c873 100644 --- a/cmd/zitadel.go +++ b/cmd/zitadel.go @@ -56,7 +56,7 @@ func New(out io.Writer, in io.Reader, args []string, server chan<- *start.Server start.New(server), start.NewStartFromInit(server), start.NewStartFromSetup(server), - mirror.New(), + mirror.New(&configFiles), key.New(), ready.New(), )