Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CWS/CSPM] use no-op status provider instead of logs one #34831

Merged
merged 1 commit into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
15 changes: 15 additions & 0 deletions pkg/security/common/status_provider.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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

// NoopStatusProvider is a no-op implementation of the StatusProvider interface
type NoopStatusProvider struct{}

// AddGlobalWarning is a no-op implementation of the StatusProvider interface
func (n *NoopStatusProvider) AddGlobalWarning(string, string) {}

// RemoveGlobalWarning is a no-op implementation of the StatusProvider interface
func (n *NoopStatusProvider) RemoveGlobalWarning(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