From 0aab1bc32895eb544de79d78c4a7d17dc120b1f1 Mon Sep 17 00:00:00 2001 From: Johnny Burns Date: Mon, 13 Apr 2020 09:29:28 -0700 Subject: [PATCH] pass command line args (#63) --- cmd/controller/cmd/root.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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