From c5fe1371b305cf8be7835d2334ad0b4541ef482d Mon Sep 17 00:00:00 2001 From: Joel Diaz Date: Wed, 29 Mar 2023 16:08:06 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20change=20viper=20binding=20from?= =?UTF-8?q?=20api-proxy=20to=20api=5Fproxy=20(#478)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this way, when the 'login' subcommand goes to save the config file, the --api-proxy that was set via CLI param just goes along for the ride and ends up in the config file. presently it ends up in the config file as 'api-proxy' which wouldn't be picked up when reading the config file. Signed-off-by: Joel Diaz --- apps/cnspec/cmd/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/cnspec/cmd/root.go b/apps/cnspec/cmd/root.go index 3304bb6a..23c6bbd5 100644 --- a/apps/cnspec/cmd/root.go +++ b/apps/cnspec/cmd/root.go @@ -97,7 +97,7 @@ func init() { rootCmd.PersistentFlags().String("api-proxy", "", "Set proxy for communications with Mondoo API") viper.BindPFlag("verbose", rootCmd.PersistentFlags().Lookup("verbose")) viper.BindPFlag("log-level", rootCmd.PersistentFlags().Lookup("log-level")) - viper.BindPFlag("api-proxy", rootCmd.PersistentFlags().Lookup("api-proxy")) + viper.BindPFlag("api_proxy", rootCmd.PersistentFlags().Lookup("api-proxy")) viper.BindEnv("features") config.Init(rootCmd)