Skip to content

Commit

Permalink
Move the component to comp/forwarder/orchestrator
Browse files Browse the repository at this point in the history
  • Loading branch information
ogaca-dd committed Nov 23, 2023
1 parent caf6083 commit 9320f52
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 49 deletions.
2 changes: 1 addition & 1 deletion cmd/agent/subcommands/run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import (
"github.com/DataDog/datadog-agent/comp/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
pkgforwarder "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
langDetectionCl "github.com/DataDog/datadog-agent/comp/languagedetection/client"
"github.com/DataDog/datadog-agent/comp/logs"
logsAgent "github.com/DataDog/datadog-agent/comp/logs/agent"
Expand All @@ -66,7 +67,6 @@ import (
"github.com/DataDog/datadog-agent/comp/metadata/runner"
"github.com/DataDog/datadog-agent/comp/ndmtmp"
"github.com/DataDog/datadog-agent/comp/netflow"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder/forwarderimpl"
"github.com/DataDog/datadog-agent/comp/otelcol"
otelcollector "github.com/DataDog/datadog-agent/comp/otelcol/collector"
"github.com/DataDog/datadog-agent/comp/remote-config/rcclient"
Expand Down
2 changes: 1 addition & 1 deletion cmd/cluster-agent-cloudfoundry/subcommands/run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors"
"github.com/DataDog/datadog-agent/comp/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder/forwarderimpl"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
"github.com/DataDog/datadog-agent/pkg/aggregator"
"github.com/DataDog/datadog-agent/pkg/api/healthprobe"
"github.com/DataDog/datadog-agent/pkg/clusteragent"
Expand Down
2 changes: 1 addition & 1 deletion cmd/cluster-agent/subcommands/start/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors"
"github.com/DataDog/datadog-agent/comp/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder/forwarderimpl"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
"github.com/DataDog/datadog-agent/pkg/aggregator"
"github.com/DataDog/datadog-agent/pkg/api/healthprobe"
"github.com/DataDog/datadog-agent/pkg/clusteragent"
Expand Down
2 changes: 1 addition & 1 deletion cmd/dogstatsd/subcommands/start/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ import (
dogstatsdServer "github.com/DataDog/datadog-agent/comp/dogstatsd/server"
"github.com/DataDog/datadog-agent/comp/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
"github.com/DataDog/datadog-agent/comp/metadata"
"github.com/DataDog/datadog-agent/comp/metadata/host"
"github.com/DataDog/datadog-agent/comp/metadata/resources/resourcesimpl"
"github.com/DataDog/datadog-agent/comp/metadata/runner"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder/forwarderimpl"
"github.com/DataDog/datadog-agent/pkg/aggregator"
"github.com/DataDog/datadog-agent/pkg/api/healthprobe"
pkgconfig "github.com/DataDog/datadog-agent/pkg/config"
Expand Down
2 changes: 1 addition & 1 deletion cmd/otel-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"github.com/DataDog/datadog-agent/comp/core/secrets"
"github.com/DataDog/datadog-agent/comp/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
"github.com/DataDog/datadog-agent/comp/logs"
logsAgent "github.com/DataDog/datadog-agent/comp/logs/agent"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder/forwarderimpl"
"github.com/DataDog/datadog-agent/comp/otelcol"
"github.com/DataDog/datadog-agent/comp/otelcol/collector"
"github.com/DataDog/datadog-agent/pkg/aggregator"
Expand Down
2 changes: 1 addition & 1 deletion cmd/security-agent/main_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/DataDog/datadog-agent/comp/dogstatsd/statsd"
"github.com/DataDog/datadog-agent/comp/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder/forwarderimpl"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"

"github.com/DataDog/datadog-agent/pkg/aggregator"
pkgconfig "github.com/DataDog/datadog-agent/pkg/config"
Expand Down
2 changes: 1 addition & 1 deletion cmd/security-agent/subcommands/start/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
"github.com/DataDog/datadog-agent/comp/dogstatsd/statsd"
"github.com/DataDog/datadog-agent/comp/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder/forwarderimpl"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
"github.com/DataDog/datadog-agent/pkg/aggregator"
pkgconfig "github.com/DataDog/datadog-agent/pkg/config"
"github.com/DataDog/datadog-agent/pkg/config/model"
Expand Down
2 changes: 1 addition & 1 deletion comp/aggregator/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer"
"github.com/DataDog/datadog-agent/comp/core"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder/forwarderimpl"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
"go.uber.org/fx"
)
Expand Down
2 changes: 1 addition & 1 deletion comp/aggregator/demultiplexer/demultiplexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/DataDog/datadog-agent/comp/aggregator/diagnosesendermanager"
"github.com/DataDog/datadog-agent/comp/core/log"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
orchestratorforwarder "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder"
orchestratorforwarder "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator"
"github.com/DataDog/datadog-agent/pkg/aggregator"
"github.com/DataDog/datadog-agent/pkg/aggregator/sender"
"github.com/DataDog/datadog-agent/pkg/util/hostname"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2023-present Datadog, Inc.

// Package forwarder implements the orchestrator forwarder component.
package forwarder
// Package orchestrator implements the orchestrator forwarder component.
package orchestrator

import "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@

//go:build !orchestrator

// Package forwarderimpl implements the orchestrator forwarder component.
package forwarderimpl
// Package orchestratorimpl implements the orchestrator forwarder component.
package orchestratorimpl

import (
"go.uber.org/fx"

"github.com/DataDog/datadog-agent/comp/core/config"
"github.com/DataDog/datadog-agent/comp/core/log"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
"github.com/DataDog/datadog-agent/comp/orchestrator/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/orchestrator"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
"github.com/DataDog/datadog-agent/pkg/util/optional"
)
Expand All @@ -27,7 +27,7 @@ var Module = fxutil.Component(
// newOrchestratorForwarder builds the orchestrator forwarder.
// This func has been extracted in this file to not include all the orchestrator
// dependencies (k8s, several MBs) while building binaries not needing these.
func newOrchestratorForwarder(_ log.Component, _ config.Component, params Params) forwarder.Component {
func newOrchestratorForwarder(_ log.Component, _ config.Component, params Params) orchestrator.Component {
if params.UseNoopOrchestratorForwarder {
forwarder := optional.NewOption[defaultforwarder.Forwarder](defaultforwarder.NoopForwarder{})
return &forwarder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@

//go:build orchestrator

// Package forwarderimpl implements the orchestrator forwarder component.
package forwarderimpl
// Package orchestratorimpl implements the orchestrator forwarder component.
package orchestratorimpl

import (
"go.uber.org/fx"

"github.com/DataDog/datadog-agent/comp/core/config"
"github.com/DataDog/datadog-agent/comp/core/log"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
"github.com/DataDog/datadog-agent/comp/orchestrator/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/orchestrator"
"github.com/DataDog/datadog-agent/pkg/config/resolver"
orchestratorconfig "github.com/DataDog/datadog-agent/pkg/orchestrator/config"
apicfg "github.com/DataDog/datadog-agent/pkg/process/util/api/config"
Expand All @@ -29,7 +29,7 @@ var Module = fxutil.Component(

// newOrchestratorForwarder returns an orchestratorForwarder
// if the feature is activated on the cluster-agent/cluster-check runner, nil otherwise
func newOrchestratorForwarder(log log.Component, config config.Component, params Params) forwarder.Component {
func newOrchestratorForwarder(log log.Component, config config.Component, params Params) orchestrator.Component {
if params.UseNoopOrchestratorForwarder {
return createComponent(defaultforwarder.NoopForwarder{})
}
Expand All @@ -54,7 +54,7 @@ func newOrchestratorForwarder(log log.Component, config config.Component, params
return &forwarder
}

func createComponent(forwarder defaultforwarder.Forwarder) forwarder.Component {
func createComponent(forwarder defaultforwarder.Forwarder) orchestrator.Component {
o := optional.NewOption(forwarder)
return &o
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

//go:build test

package forwarderimpl
package orchestratorimpl

import (
"go.uber.org/fx"

"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
"github.com/DataDog/datadog-agent/comp/orchestrator/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/orchestrator"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
"github.com/DataDog/datadog-agent/pkg/util/optional"
)
Expand All @@ -22,7 +22,7 @@ var MockModule = fxutil.Component(
)

// NewMockOrchestratorForwarder returns an orchestratorForwarder
func NewMockOrchestratorForwarder() forwarder.Component {
func NewMockOrchestratorForwarder() orchestrator.Component {
forwarder := optional.NewOption[defaultforwarder.Forwarder](defaultforwarder.NoopForwarder{})
return &forwarder

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2023-present Datadog, Inc.

package forwarderimpl
package orchestratorimpl

// Params defines the parameters for the orchestrator forwarder.
type Params struct {
Expand Down
2 changes: 1 addition & 1 deletion comp/ndmtmp/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer"
"github.com/DataDog/datadog-agent/comp/core"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder/forwarderimpl"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
ddagg "github.com/DataDog/datadog-agent/pkg/aggregator"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
"go.uber.org/fx"
Expand Down
19 changes: 0 additions & 19 deletions comp/orchestrator/bundle.go

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/aggregator/demultiplexer_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/DataDog/datadog-agent/comp/core/log"
forwarder "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
orchestratorforwarder "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder"
orchestratorforwarder "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator"
"github.com/DataDog/datadog-agent/pkg/aggregator/internal/limiter"
"github.com/DataDog/datadog-agent/pkg/aggregator/internal/tags"
"github.com/DataDog/datadog-agent/pkg/aggregator/internal/tags_limiter"
Expand Down
4 changes: 2 additions & 2 deletions pkg/aggregator/demultiplexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/DataDog/datadog-agent/comp/core/config"
"github.com/DataDog/datadog-agent/comp/core/log"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
orchestratorForwarder "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder/forwarderimpl"
orchestratorForwarder "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
checkid "github.com/DataDog/datadog-agent/pkg/collector/check/id"
pkgconfig "github.com/DataDog/datadog-agent/pkg/config"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/subcommands/check/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"github.com/DataDog/datadog-agent/comp/core/workloadmeta"
"github.com/DataDog/datadog-agent/comp/forwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder/forwarderimpl"
orchestratorForwarderImpl "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorimpl"
"github.com/DataDog/datadog-agent/pkg/aggregator"
"github.com/DataDog/datadog-agent/pkg/autodiscovery"
"github.com/DataDog/datadog-agent/pkg/autodiscovery/integration"
Expand Down
2 changes: 1 addition & 1 deletion pkg/serializer/serializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

forwarder "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder"
"github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder/transaction"
orchestratorForwarder "github.com/DataDog/datadog-agent/comp/orchestrator/forwarder"
orchestratorForwarder "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator"
"github.com/DataDog/datadog-agent/pkg/config"
"github.com/DataDog/datadog-agent/pkg/metrics"
"github.com/DataDog/datadog-agent/pkg/metrics/event"
Expand Down

0 comments on commit 9320f52

Please sign in to comment.