From 73fe9af3806645222a7980ee3ebfb59a64e7ed66 Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Mon, 18 Nov 2024 10:45:05 +0100 Subject: [PATCH] Make linters happy --- pkg/security/resolvers/resolvers_ebpf.go | 2 +- pkg/security/resolvers/resolvers_ebpfless.go | 2 +- pkg/security/resolvers/resolvers_windows.go | 2 +- pkg/security/resolvers/tags/resolver.go | 3 +-- pkg/security/resolvers/tags/resolver_linux.go | 5 ++--- pkg/security/resolvers/tags/resolver_other.go | 5 ++--- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/pkg/security/resolvers/resolvers_ebpf.go b/pkg/security/resolvers/resolvers_ebpf.go index c67c72de99e05..39343334d1b8d 100644 --- a/pkg/security/resolvers/resolvers_ebpf.go +++ b/pkg/security/resolvers/resolvers_ebpf.go @@ -96,7 +96,7 @@ func NewEBPFResolvers(config *config.Config, manager *manager.Manager, statsdCli return nil, err } - tagsResolver := tags.NewResolver(config.Probe, telemetry, opts.Tagger, cgroupsResolver) + tagsResolver := tags.NewResolver(telemetry, opts.Tagger, cgroupsResolver) userGroupResolver, err := usergroup.NewResolver(cgroupsResolver) if err != nil { diff --git a/pkg/security/resolvers/resolvers_ebpfless.go b/pkg/security/resolvers/resolvers_ebpfless.go index 76ebe838f636c..6713106a1f86c 100644 --- a/pkg/security/resolvers/resolvers_ebpfless.go +++ b/pkg/security/resolvers/resolvers_ebpfless.go @@ -38,7 +38,7 @@ func NewEBPFLessResolvers(config *config.Config, statsdClient statsd.ClientInter return nil, err } - tagsResolver := tags.NewResolver(config.Probe, telemetry, opts.Tagger, cgroupsResolver) + tagsResolver := tags.NewResolver(telemetry, opts.Tagger, cgroupsResolver) processOpts := process.NewResolverOpts() processOpts.WithEnvsValue(config.Probe.EnvsWithValue) diff --git a/pkg/security/resolvers/resolvers_windows.go b/pkg/security/resolvers/resolvers_windows.go index 2993025a2f4e2..2df2a38813070 100644 --- a/pkg/security/resolvers/resolvers_windows.go +++ b/pkg/security/resolvers/resolvers_windows.go @@ -35,7 +35,7 @@ func NewResolvers(config *config.Config, statsdClient statsd.ClientInterface, sc return nil, err } - tagsResolver := tags.NewResolver(config.Probe, telemetry, nil) + tagsResolver := tags.NewResolver(telemetry, nil) userSessionsResolver, err := usersessions.NewResolver(config.RuntimeSecurity) if err != nil { diff --git a/pkg/security/resolvers/tags/resolver.go b/pkg/security/resolvers/tags/resolver.go index 641fda2be9331..1674d5d30b6c0 100644 --- a/pkg/security/resolvers/tags/resolver.go +++ b/pkg/security/resolvers/tags/resolver.go @@ -18,7 +18,6 @@ import ( "github.com/DataDog/datadog-agent/comp/core/telemetry" "github.com/DataDog/datadog-agent/pkg/api/security" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" - "github.com/DataDog/datadog-agent/pkg/security/probe/config" "github.com/DataDog/datadog-agent/pkg/security/utils" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -98,7 +97,7 @@ func (t *DefaultResolver) Stop() error { } // NewDefaultResolver returns a new default tags resolver -func NewDefaultResolver(config *config.Config, telemetry telemetry.Component, tagger Tagger) *DefaultResolver { +func NewDefaultResolver(telemetry telemetry.Component, tagger Tagger) *DefaultResolver { ddConfig := pkgconfigsetup.Datadog() resolver := &DefaultResolver{ tagger: tagger, diff --git a/pkg/security/resolvers/tags/resolver_linux.go b/pkg/security/resolvers/tags/resolver_linux.go index 6b28532d7b49a..7730902212f87 100644 --- a/pkg/security/resolvers/tags/resolver_linux.go +++ b/pkg/security/resolvers/tags/resolver_linux.go @@ -12,7 +12,6 @@ import ( "time" "github.com/DataDog/datadog-agent/comp/core/telemetry" - "github.com/DataDog/datadog-agent/pkg/security/probe/config" "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup" cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" "github.com/DataDog/datadog-agent/pkg/security/utils" @@ -90,10 +89,10 @@ func (t *LinuxResolver) fetchTags(container *cgroupModel.CacheEntry) error { } // NewResolver returns a new tags resolver -func NewResolver(config *config.Config, telemetry telemetry.Component, tagger Tagger, cgroupsResolver *cgroup.Resolver) *LinuxResolver { +func NewResolver(telemetry telemetry.Component, tagger Tagger, cgroupsResolver *cgroup.Resolver) *LinuxResolver { resolver := &LinuxResolver{ Notifier: utils.NewNotifier[Event, *cgroupModel.CacheEntry](), - DefaultResolver: NewDefaultResolver(config, telemetry, tagger), + DefaultResolver: NewDefaultResolver(telemetry, tagger), workloadsWithoutTags: make(chan *cgroupModel.CacheEntry, 100), cgroupResolver: cgroupsResolver, } diff --git a/pkg/security/resolvers/tags/resolver_other.go b/pkg/security/resolvers/tags/resolver_other.go index 177001a1c2388..d00f07ce02113 100644 --- a/pkg/security/resolvers/tags/resolver_other.go +++ b/pkg/security/resolvers/tags/resolver_other.go @@ -10,10 +10,9 @@ package tags import ( "github.com/DataDog/datadog-agent/comp/core/telemetry" - "github.com/DataDog/datadog-agent/pkg/security/probe/config" ) // NewResolver returns a new tags resolver -func NewResolver(config *config.Config, telemetry telemetry.Component, tagger Tagger) Resolver { - return NewDefaultResolver(config, telemetry, tagger) +func NewResolver(telemetry telemetry.Component, tagger Tagger) Resolver { + return NewDefaultResolver(telemetry, tagger) }