Skip to content

Commit

Permalink
[CWS/CSPM] use no-op status provider instead of logs one
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux committed Mar 6, 2025
1 parent 8af78c4 commit 04397fb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pkg/compliance/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"time"

"github.com/DataDog/datadog-agent/comp/core/hostname/hostnameimpl"
"github.com/DataDog/datadog-agent/comp/logs/agent/agentimpl"
"github.com/DataDog/datadog-agent/comp/logs/agent/config"
logscompression "github.com/DataDog/datadog-agent/comp/serializer/logscompression/def"
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
Expand Down Expand Up @@ -45,7 +44,7 @@ func NewLogReporter(hostname string, sourceName, sourceType string, endpoints *c
auditor.Start()

// setup the pipeline provider that provides pairs of processor and sender
pipelineProvider := pipeline.NewProvider(4, auditor, &diagnostic.NoopMessageReceiver{}, nil, endpoints, dstcontext, agentimpl.NewStatusProvider(), hostnameimpl.NewHostnameService(), pkgconfigsetup.Datadog(), compression)
pipelineProvider := pipeline.NewProvider(4, auditor, &diagnostic.NoopMessageReceiver{}, nil, endpoints, dstcontext, &common.NoopStatusProvider{}, hostnameimpl.NewHostnameService(), pkgconfigsetup.Datadog(), compression)
pipelineProvider.Start()

logSource := sources.NewLogSource(
Expand Down
12 changes: 12 additions & 0 deletions pkg/security/common/status_provider.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

package common

type NoopStatusProvider struct{}

func (n *NoopStatusProvider) AddGlobalWarning(string, string) {}

func (n *NoopStatusProvider) RemoveGlobalWarning(key string) {}
3 changes: 1 addition & 2 deletions pkg/security/reporter/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"time"

"github.com/DataDog/datadog-agent/comp/core/hostname/hostnameimpl"
"github.com/DataDog/datadog-agent/comp/logs/agent/agentimpl"
logsconfig "github.com/DataDog/datadog-agent/comp/logs/agent/config"
compression "github.com/DataDog/datadog-agent/comp/serializer/logscompression/def"
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
Expand Down Expand Up @@ -53,7 +52,7 @@ func newReporter(hostname string, stopper startstop.Stopper, sourceName, sourceT
stopper.Add(auditor)

// setup the pipeline provider that provides pairs of processor and sender
pipelineProvider := pipeline.NewProvider(4, auditor, &diagnostic.NoopMessageReceiver{}, nil, endpoints, context, agentimpl.NewStatusProvider(), hostnameimpl.NewHostnameService(), pkgconfigsetup.Datadog(), compression)
pipelineProvider := pipeline.NewProvider(4, auditor, &diagnostic.NoopMessageReceiver{}, nil, endpoints, context, &seccommon.NoopStatusProvider{}, hostnameimpl.NewHostnameService(), pkgconfigsetup.Datadog(), compression)
pipelineProvider.Start()
stopper.Add(pipelineProvider)

Expand Down

0 comments on commit 04397fb

Please sign in to comment.