From 07633f34180aaa8066efc40a2955780dfd82fbd9 Mon Sep 17 00:00:00 2001 From: Paul Cacheux Date: Thu, 23 Nov 2023 22:38:48 +0100 Subject: [PATCH] fix `cconfig.NewAgentParams` in dogstatsd and secrets passing in jmx command (#21078) --- cmd/agent/subcommands/dogstatsd/command.go | 4 ++-- pkg/cli/standalone/jmx.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/agent/subcommands/dogstatsd/command.go b/cmd/agent/subcommands/dogstatsd/command.go index e92948036b6e0..48ef84f0ac0e9 100644 --- a/cmd/agent/subcommands/dogstatsd/command.go +++ b/cmd/agent/subcommands/dogstatsd/command.go @@ -51,7 +51,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { return fxutil.OneShot(topContexts, fx.Supply(&topFlags), fx.Supply(core.BundleParams{ - ConfigParams: cconfig.NewAgentParamsWithoutSecrets(globalParams.ConfFilePath), + ConfigParams: cconfig.NewAgentParams(globalParams.ConfFilePath), LogParams: log.ForOneShot(command.LoggerName, "off", true)}), core.Bundle, ) @@ -69,7 +69,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { RunE: func(cmd *cobra.Command, args []string) error { return fxutil.OneShot(dumpContexts, fx.Supply(core.BundleParams{ - ConfigParams: cconfig.NewAgentParamsWithoutSecrets(globalParams.ConfFilePath), + ConfigParams: cconfig.NewAgentParams(globalParams.ConfFilePath), LogParams: log.ForOneShot(command.LoggerName, "off", true)}), core.Bundle, diff --git a/pkg/cli/standalone/jmx.go b/pkg/cli/standalone/jmx.go index 89e2bb32c6f5c..a71a530c7e561 100644 --- a/pkg/cli/standalone/jmx.go +++ b/pkg/cli/standalone/jmx.go @@ -58,7 +58,7 @@ func ExecJmxListWithRateMetricsJSON(selectedChecks []string, logLevel string, co // The common utils, including AutoConfig, must have already been initialized. func execJmxCommand(command string, selectedChecks []string, reporter jmxfetch.JMXReporter, output func(...interface{}), logLevel string, configs []integration.Config, wmeta workloadmeta.Component, senderManager sender.DiagnoseSenderManager) error { // start the cmd HTTP server - if err := api.StartServer(nil, nil, nil, nil, nil, wmeta, optional.NewNoneOption[logsAgent.Component](), senderManager, nil, nil, nil, nil); err != nil { + if err := api.StartServer(nil, nil, nil, nil, nil, wmeta, optional.NewNoneOption[logsAgent.Component](), senderManager, nil, nil, nil, nil, nil); err != nil { return fmt.Errorf("Error while starting api server, exiting: %v", err) }