diff --git a/cmd/security-agent/main_windows.go b/cmd/security-agent/main_windows.go index 6aa47f99d56b4..b81223e6aebc1 100644 --- a/cmd/security-agent/main_windows.go +++ b/cmd/security-agent/main_windows.go @@ -121,17 +121,8 @@ func (s *service) Run(svcctx context.Context) error { // workloadmeta setup wmcatalog.GetCatalog(), - workloadmetafx.ModuleWithProvider(func(config config.Component) workloadmeta.Params { - - catalog := workloadmeta.NodeAgent - - if config.GetBool("security_agent.remote_workloadmeta") { - catalog = workloadmeta.Remote - } - - return workloadmeta.Params{ - AgentType: catalog, - } + workloadmetafx.Module(workloadmeta.Params{ + AgentType: workloadmeta.Remote, }), fx.Provide(func(log log.Component, config config.Component, statsd statsd.Component, wmeta workloadmeta.Component) (status.InformationProvider, *agent.RuntimeSecurityAgent, error) { stopper := startstop.NewSerialStopper() diff --git a/cmd/security-agent/subcommands/start/command.go b/cmd/security-agent/subcommands/start/command.go index 6dec7ce712a4e..8386100c0031b 100644 --- a/cmd/security-agent/subcommands/start/command.go +++ b/cmd/security-agent/subcommands/start/command.go @@ -48,7 +48,7 @@ import ( remoteTaggerfx "github.com/DataDog/datadog-agent/comp/core/tagger/fx-remote" taggerTypes "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/comp/core/telemetry" - wmcatalog "github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors/catalog" + wmcatalog "github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors/catalog-remote" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx" "github.com/DataDog/datadog-agent/comp/dogstatsd" @@ -104,14 +104,8 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { dogstatsd.ClientBundle, // workloadmeta setup wmcatalog.GetCatalog(), - workloadmetafx.ModuleWithProvider(func(config config.Component) workloadmeta.Params { - catalog := workloadmeta.NodeAgent - if config.GetBool("security_agent.remote_workloadmeta") { - catalog = workloadmeta.Remote - } - return workloadmeta.Params{ - AgentType: catalog, - } + workloadmetafx.Module(workloadmeta.Params{ + AgentType: workloadmeta.Remote, }), remoteTaggerfx.Module(tagger.RemoteParams{ RemoteTarget: func(c config.Component) (string, error) { diff --git a/pkg/config/setup/config.go b/pkg/config/setup/config.go index a19de1ebed171..da2fb45d704bb 100644 --- a/pkg/config/setup/config.go +++ b/pkg/config/setup/config.go @@ -898,7 +898,6 @@ func InitConfig(config pkgconfigmodel.Setup) { config.BindEnvAndSetDefault("security_agent.cmd_port", DefaultSecurityAgentCmdPort) config.BindEnvAndSetDefault("security_agent.expvar_port", 5011) config.BindEnvAndSetDefault("security_agent.log_file", DefaultSecurityAgentLogFile) - config.BindEnvAndSetDefault("security_agent.remote_workloadmeta", true) // debug config to enable a remote client to receive data from the workloadmeta agent without a timeout config.BindEnvAndSetDefault("workloadmeta.remote.recv_without_timeout", true)