diff --git a/cmd/controller/cmd/root.go b/cmd/controller/cmd/root.go index 315df65335..c5b7ca040c 100644 --- a/cmd/controller/cmd/root.go +++ b/cmd/controller/cmd/root.go @@ -94,12 +94,14 @@ func init() { rootCmd.AddCommand(viper.GetConfigCommand()) } -func initConfig(_ *cobra.Command, _ []string) error { +func initConfig(cmd *cobra.Command, _ []string) error { configAccessor = viper.NewAccessor(config.Options{ StrictMode: true, SearchPaths: []string{cfgFile}, }) + configAccessor.InitializePflags(cmd.Flags()) + err := configAccessor.UpdateConfig(context.TODO()) if err != nil { return err