From 988243b935deab0fd3fe81cf20f51ae6118d2259 Mon Sep 17 00:00:00 2001 From: Sebastian Choren Date: Thu, 25 Jul 2024 19:00:55 -0300 Subject: [PATCH] fix flag for configure cmd --- cli/cmd/configure_cmd.go | 3 ++- cli/cmd/root.go | 1 + cli/cmd/start_cmd.go | 4 +--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/cmd/configure_cmd.go b/cli/cmd/configure_cmd.go index d757a24c6a..0032638b58 100644 --- a/cli/cmd/configure_cmd.go +++ b/cli/cmd/configure_cmd.go @@ -24,7 +24,8 @@ var configureCmd = &cobra.Command{ PreRun: setupLogger, Run: WithResultHandler(WithParamsHandler(configParams)(func(ctx context.Context, cmd *cobra.Command, _ []string) (string, error) { flags := agentConfig.Flags{ - CI: configParams.CI, + CI: configParams.CI, + SkipVerify: cliConfig.SkipVerify, } config, err := config.LoadConfig("") diff --git a/cli/cmd/root.go b/cli/cmd/root.go index b73ad1d65f..624bd4588c 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -78,6 +78,7 @@ func init() { rootCmd.PersistentFlags().StringVarP(&configFile, "config", "c", "config.yml", "config file will be used by the CLI") rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "display debug information") rootCmd.PersistentFlags().StringVarP(&overrideEndpoint, "server-url", "s", "", "server url") + rootCmd.PersistentFlags().BoolVarP(&cliConfig.SkipVerify, "skip-verify", "", false, "skip verification of the server certificate (allows self signed, for example)") groups := []*cobra.Group{cmdGroupConfig, cmdGroupResources, cmdGroupMisc} diff --git a/cli/cmd/start_cmd.go b/cli/cmd/start_cmd.go index 69923c2878..7f5a841b42 100644 --- a/cli/cmd/start_cmd.go +++ b/cli/cmd/start_cmd.go @@ -36,7 +36,7 @@ var startCmd = &cobra.Command{ LogLevel: startParams.logLevel, CollectorEndpoint: startParams.collectorEndpoint, Insecure: startParams.insecure, - SkipVerify: startParams.skipVerify, + SkipVerify: cliConfig.SkipVerify, } // override organization and environment id from context. @@ -92,7 +92,6 @@ func init() { startCmd.Flags().StringVarP(&startParams.logLevel, "log-level", "l", "debug", "set the agent log level") startCmd.Flags().StringVarP(&startParams.collectorEndpoint, "collector-endpoint", "", "", "address of the OTel Collector endpoint") startCmd.Flags().BoolVarP(&startParams.insecure, "insecure", "", false, "allow insecure connections to control plane") - startCmd.Flags().BoolVarP(&startParams.skipVerify, "skip-verify", "", false, "skip verification of the server certificate (allows self signed, for example)") startCmd.Flags().MarkDeprecated("endpoint", "use --server-url instead") startCmd.Flags().MarkShorthandDeprecated("e", "use --server-url instead") @@ -109,5 +108,4 @@ type startParameters struct { logLevel string collectorEndpoint string insecure bool - skipVerify bool }