From 6af669bed23527712174adcb519866b44eb41470 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/tags/resolver.go | 3 +-- pkg/security/resolvers/tags/resolver_linux.go | 5 ++--- pkg/security/resolvers/tags/resolver_other.go | 5 ++--- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/pkg/security/resolvers/resolvers_ebpf.go b/pkg/security/resolvers/resolvers_ebpf.go index c67c72de99e058..39343334d1b8db 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 76ebe838f636c4..6713106a1f86ca 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/tags/resolver.go b/pkg/security/resolvers/tags/resolver.go index 641fda2be93314..1674d5d30b6c02 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 6b28532d7b49a0..7730902212f874 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 177001a1c2388d..d00f07ce02113d 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) }