Skip to content

Commit

Permalink
Fix FX loading
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianVeaux committed Oct 10, 2024
1 parent 3305587 commit 2daecb7
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions cmd/agent/subcommands/snmp/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 (
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 2daecb7

Please sign in to comment.