From 2daecb71fcc912e12d0f634afcd5f47384786486 Mon Sep 17 00:00:00 2001 From: Florian Veaux Date: Thu, 10 Oct 2024 14:15:13 +0200 Subject: [PATCH] Fix FX loading --- cmd/agent/subcommands/snmp/command.go | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/cmd/agent/subcommands/snmp/command.go b/cmd/agent/subcommands/snmp/command.go index ef112132959fe..46e865f7b9d45 100644 --- a/cmd/agent/subcommands/snmp/command.go +++ b/cmd/agent/subcommands/snmp/command.go @@ -14,14 +14,8 @@ import ( "strconv" "time" - "github.com/DataDog/datadog-agent/comp/aggregator" - "github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl" - - "github.com/gosnmp/gosnmp" - "github.com/spf13/cobra" - "go.uber.org/fx" - "github.com/DataDog/datadog-agent/cmd/agent/command" + "github.com/DataDog/datadog-agent/comp/aggregator" "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl" "github.com/DataDog/datadog-agent/comp/core" "github.com/DataDog/datadog-agent/comp/core/config" @@ -38,6 +32,10 @@ import ( "github.com/DataDog/datadog-agent/comp/snmptraps/snmplog" "github.com/DataDog/datadog-agent/pkg/snmp/snmpparse" "github.com/DataDog/datadog-agent/pkg/util/fxutil" + + "github.com/gosnmp/gosnmp" + "github.com/spf13/cobra" + "go.uber.org/fx" ) const ( @@ -139,16 +137,12 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { LogParams: log.ForOneShot(command.LoggerName, "info", true)}), core.Bundle(), snmpscanfx.Module(), - demultiplexerimpl.Module(), + demultiplexerimpl.Module(demultiplexerimpl.NewDefaultParams()), forwarder.Bundle(defaultforwarder.NewParams(defaultforwarder.WithFeatures(defaultforwarder.CoreFeatures))), - orchestratorimpl.Module(), + orchestratorimpl.Module(orchestratorimpl.NewDefaultParams()), eventplatformimpl.Module(eventplatformimpl.NewDefaultParams()), compressionimpl.Module(), eventplatformreceiverimpl.Module(), - fx.Provide( - orchestratorimpl.NewDefaultParams, - demultiplexerimpl.NewDefaultParams, - ), ) if err != nil { var ue configErr @@ -193,7 +187,6 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { err := fxutil.OneShot(scanDevice, fx.Supply(connParams, globalParams, cmd), fx.Provide(func() argsType { return args }), - compressionimpl.Module(), fx.Supply(core.BundleParams{ ConfigParams: config.NewAgentParams(globalParams.ConfFilePath, config.WithExtraConfFiles(globalParams.ExtraConfFilePath), config.WithFleetPoliciesDirPath(globalParams.FleetPoliciesDirPath)), SecretParams: secrets.NewEnabledParams(),