Skip to content

Commit

Permalink
[AGENTRUN-139] migrate all agent start command to use createorfetch a…
Browse files Browse the repository at this point in the history
…uth impl (#34258)
  • Loading branch information
misteriaud authored Feb 24, 2025
1 parent b9d7db8 commit f146db9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/dogstatsd/subcommands/start/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/DataDog/datadog-agent/cmd/agent/common"
"github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer"
"github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl"
authtokenimpl "github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl"
authtokenimpl "github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl"
"github.com/DataDog/datadog-agent/comp/core/config"
healthprobe "github.com/DataDog/datadog-agent/comp/core/healthprobe/def"
healthprobefx "github.com/DataDog/datadog-agent/comp/core/healthprobe/fx"
Expand Down
6 changes: 3 additions & 3 deletions cmd/otel-agent/subcommands/run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/DataDog/datadog-agent/cmd/agent/common"
agentConfig "github.com/DataDog/datadog-agent/cmd/otel-agent/config"
"github.com/DataDog/datadog-agent/cmd/otel-agent/subcommands"
"github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl"
"github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl"
coreconfig "github.com/DataDog/datadog-agent/comp/core/config"
"github.com/DataDog/datadog-agent/comp/core/configsync"
"github.com/DataDog/datadog-agent/comp/core/configsync/configsyncimpl"
Expand Down Expand Up @@ -113,7 +113,7 @@ func runOTelAgentCommand(ctx context.Context, params *subcommands.GlobalParams,
return log.ForDaemon(params.LoggerName, "log_file", pkgconfigsetup.DefaultOTelAgentLogFile)
}),
logfx.Module(),
fetchonlyimpl.Module(),
createandfetchimpl.Module(),
configsyncimpl.Module(configsyncimpl.NewParams(params.SyncTimeout, true, params.SyncOnInitTimeout)),
converterfx.Module(),
fx.Provide(func(cp converter.Component, _ configsync.Component) confmap.Converter {
Expand All @@ -135,7 +135,7 @@ func runOTelAgentCommand(ctx context.Context, params *subcommands.GlobalParams,
fx.Provide(func(client *metricsclient.StatsdClientWrapper) statsd.Component {
return statsd.NewOTelStatsd(client)
}),
fetchonlyimpl.Module(),
createandfetchimpl.Module(),
collectorfx.Module(),
collectorcontribFx.Module(),
converterfx.Module(),
Expand Down
4 changes: 2 additions & 2 deletions cmd/process-agent/command/main_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/DataDog/datadog-agent/cmd/agent/common/misconfig"
"github.com/DataDog/datadog-agent/comp/agent/autoexit"
"github.com/DataDog/datadog-agent/comp/agent/autoexit/autoexitimpl"
"github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl"
"github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl"
"github.com/DataDog/datadog-agent/comp/core"
"github.com/DataDog/datadog-agent/comp/core/config"
"github.com/DataDog/datadog-agent/comp/core/configsync/configsyncimpl"
Expand Down Expand Up @@ -151,7 +151,7 @@ func runApp(ctx context.Context, globalParams *GlobalParams) error {
compstatsd.Module(),

// Provide authtoken module
fetchonlyimpl.Module(),
createandfetchimpl.Module(),

// Provide configsync module
configsyncimpl.Module(configsyncimpl.NewDefaultParams()),
Expand Down
4 changes: 2 additions & 2 deletions cmd/security-agent/main_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/DataDog/datadog-agent/comp/agent/autoexit"
"github.com/DataDog/datadog-agent/comp/agent/autoexit/autoexitimpl"
"github.com/DataDog/datadog-agent/comp/api/authtoken"
"github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl"
"github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl"
"github.com/DataDog/datadog-agent/comp/core"
"github.com/DataDog/datadog-agent/comp/core/config"
"github.com/DataDog/datadog-agent/comp/core/configsync/configsyncimpl"
Expand Down Expand Up @@ -165,7 +165,7 @@ func (s *service) Run(svcctx context.Context) error {

statusimpl.Module(),

fetchonlyimpl.Module(),
createandfetchimpl.Module(),
configsyncimpl.Module(configsyncimpl.NewDefaultParams()),
autoexitimpl.Module(),
fx.Provide(func(c config.Component) settings.Params {
Expand Down
4 changes: 2 additions & 2 deletions cmd/security-agent/subcommands/start/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/DataDog/datadog-agent/comp/agent/autoexit"
"github.com/DataDog/datadog-agent/comp/agent/autoexit/autoexitimpl"
"github.com/DataDog/datadog-agent/comp/api/authtoken"
"github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl"
"github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl"
"github.com/DataDog/datadog-agent/comp/core"
"github.com/DataDog/datadog-agent/comp/core/config"
"github.com/DataDog/datadog-agent/comp/core/configsync/configsyncimpl"
Expand Down Expand Up @@ -173,7 +173,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
})
}),
statusimpl.Module(),
fetchonlyimpl.Module(),
createandfetchimpl.Module(),
configsyncimpl.Module(configsyncimpl.NewDefaultParams()),
autoexitimpl.Module(),
fx.Supply(pidimpl.NewParams(params.pidfilePath)),
Expand Down
4 changes: 2 additions & 2 deletions cmd/trace-agent/subcommands/run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/DataDog/datadog-agent/cmd/trace-agent/subcommands"
"github.com/DataDog/datadog-agent/comp/agent/autoexit"
"github.com/DataDog/datadog-agent/comp/agent/autoexit/autoexitimpl"
"github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl"
"github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl"
coreconfig "github.com/DataDog/datadog-agent/comp/core/config"
"github.com/DataDog/datadog-agent/comp/core/configsync/configsyncimpl"
log "github.com/DataDog/datadog-agent/comp/core/log/def"
Expand Down Expand Up @@ -111,7 +111,7 @@ func runTraceAgentProcess(ctx context.Context, cliParams *Params, defaultConfPat
}),
zstdfx.Module(),
trace.Bundle(),
fetchonlyimpl.Module(),
createandfetchimpl.Module(),
configsyncimpl.Module(configsyncimpl.NewDefaultParams()),
// Force the instantiation of the components
fx.Invoke(func(_ traceagent.Component, _ autoexit.Component) {}),
Expand Down

0 comments on commit f146db9

Please sign in to comment.