From 79246d93c9e74e15bd3bc7478a1ac4f53ba070b6 Mon Sep 17 00:00:00 2001 From: Stephen Wakely Date: Thu, 28 Nov 2024 14:36:40 +0000 Subject: [PATCH] Lints Signed-off-by: Stephen Wakely --- .../diagnosesendermanagerimpl/sendermanager.go | 13 +++++++------ .../otlp/integrationtest/integration_test.go | 2 +- pkg/aggregator/aggregator_test.go | 2 ++ pkg/aggregator/demultiplexer_agent_test.go | 7 ++++--- pkg/aggregator/demultiplexer_test.go | 2 +- pkg/aggregator/sender_test.go | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/comp/aggregator/diagnosesendermanager/diagnosesendermanagerimpl/sendermanager.go b/comp/aggregator/diagnosesendermanager/diagnosesendermanagerimpl/sendermanager.go index a134b9c9bf9a6..d5e939b299280 100644 --- a/comp/aggregator/diagnosesendermanager/diagnosesendermanagerimpl/sendermanager.go +++ b/comp/aggregator/diagnosesendermanager/diagnosesendermanagerimpl/sendermanager.go @@ -35,12 +35,13 @@ func Module() fxutil.Module { type dependencies struct { fx.In - Log log.Component - Config config.Component - Hostname hostname.Component - Compressor compression.Component - Tagger tagger.Component - HaAgent haagent.Component + Log log.Component + Config config.Component + Hostname hostname.Component + CompressionFactory compression.Factory + Compressor compression.Component + Tagger tagger.Component + HaAgent haagent.Component } type diagnoseSenderManager struct { diff --git a/comp/otelcol/otlp/integrationtest/integration_test.go b/comp/otelcol/otlp/integrationtest/integration_test.go index 19ae742479407..11840d96834de 100644 --- a/comp/otelcol/otlp/integrationtest/integration_test.go +++ b/comp/otelcol/otlp/integrationtest/integration_test.go @@ -64,7 +64,7 @@ import ( "github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient" "github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil" compression "github.com/DataDog/datadog-agent/comp/serializer/compression/def" - compressionfx "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-factory" + compressionfx "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock" implzlib "github.com/DataDog/datadog-agent/comp/serializer/compression/impl-zlib" tracecomp "github.com/DataDog/datadog-agent/comp/trace" traceagentcomp "github.com/DataDog/datadog-agent/comp/trace/agent/impl" diff --git a/pkg/aggregator/aggregator_test.go b/pkg/aggregator/aggregator_test.go index a60e3055f2206..be8f41c085e4e 100644 --- a/pkg/aggregator/aggregator_test.go +++ b/pkg/aggregator/aggregator_test.go @@ -28,6 +28,7 @@ import ( "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform" orchestratorforwarder "github.com/DataDog/datadog-agent/comp/forwarder/orchestrator" haagentmock "github.com/DataDog/datadog-agent/comp/haagent/mock" + compression "github.com/DataDog/datadog-agent/comp/serializer/compression/def" compressionmock "github.com/DataDog/datadog-agent/comp/serializer/compression/fx-mock" checkid "github.com/DataDog/datadog-agent/pkg/collector/check/id" configmock "github.com/DataDog/datadog-agent/pkg/config/mock" @@ -740,6 +741,7 @@ type aggregatorDeps struct { Demultiplexer *AgentDemultiplexer OrchestratorFwd orchestratorforwarder.Component EventPlatformFwd eventplatform.Component + Compressor compression.Component } func createAggrDeps(t *testing.T) aggregatorDeps { diff --git a/pkg/aggregator/demultiplexer_agent_test.go b/pkg/aggregator/demultiplexer_agent_test.go index 864b1a8d28f27..28fc8604a5f86 100644 --- a/pkg/aggregator/demultiplexer_agent_test.go +++ b/pkg/aggregator/demultiplexer_agent_test.go @@ -158,9 +158,10 @@ type DemultiplexerAgentTestDeps struct { TestDeps OrchestratorFwd orchestratorforwarder.Component EventPlatform eventplatform.Component - Compressor compression.Factory - Tagger tagger.Component - HaAgent haagent.Component + // just changed from factory to component. Do we need both? + Compressor compression.Component + Tagger tagger.Component + HaAgent haagent.Component } func createDemultiplexerAgentTestDeps(t *testing.T) DemultiplexerAgentTestDeps { diff --git a/pkg/aggregator/demultiplexer_test.go b/pkg/aggregator/demultiplexer_test.go index eaa44932119dd..72ed3464eb346 100644 --- a/pkg/aggregator/demultiplexer_test.go +++ b/pkg/aggregator/demultiplexer_test.go @@ -281,7 +281,7 @@ type internalDemutiplexerDeps struct { TestDeps OrchestratorForwarder orchestratorForwarder.Component Eventplatform eventplatform.Component - Compressor compression.Factory + Compressor compression.Component } func createDemuxDepsWithOrchestratorFwd( diff --git a/pkg/aggregator/sender_test.go b/pkg/aggregator/sender_test.go index 994cc96969d1c..5c39707c038ac 100644 --- a/pkg/aggregator/sender_test.go +++ b/pkg/aggregator/sender_test.go @@ -58,7 +58,7 @@ func testDemux(log log.Component, hostname hostname.Component) *AgentDemultiplex opts := DefaultAgentDemultiplexerOptions() opts.DontStartForwarders = true orchestratorForwarder := optional.NewOption[defaultforwarder.Forwarder](defaultforwarder.NoopForwarder{}) - eventPlatformForwarder := optional.NewOptionPtr[eventplatform.Forwarder](eventplatformimpl.NewNoopEventPlatformForwarder(hostname)) + eventPlatformForwarder := optional.NewOptionPtr[eventplatform.Forwarder](eventplatformimpl.NewNoopEventPlatformForwarder(hostname, compressionmock.NewMockCompressorFactory())) demux := initAgentDemultiplexer(log, NewForwarderTest(log), &orchestratorForwarder, opts, eventPlatformForwarder, haagentmock.NewMockHaAgent(), compressionmock.NewMockCompressor(), nooptagger.NewComponent(), defaultHostname) return demux }