Skip to content
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
8 changes: 4 additions & 4 deletions filebeat/autodiscover/builder/hints/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ type logHints struct {

// InitializeModule initializes this module.
func InitializeModule() {
_ = autodiscover.Registry.AddBuilder("hints", NewLogHints)
_ = autodiscover.Registry.AddBuilder("hints", newLogHints)
}

// NewLogHints builds a log hints builder
func NewLogHints(cfg *conf.C, logger *logp.Logger) (autodiscover.Builder, error) {
// newLogHints builds a log hints builder
func newLogHints(cfg *conf.C, logger *logp.Logger, paths *paths.Path) (autodiscover.Builder, error) {
config := defaultConfig()
if err := cfg.Unpack(&config); err != nil {
return nil, fmt.Errorf("unable to unpack hints config due to error: %w", err)
}

moduleRegistry, err := fileset.NewModuleRegistry(nil, beat.Info{Logger: logger}, false, fileset.FilesetOverrides{}, paths.Paths)
moduleRegistry, err := fileset.NewModuleRegistry(nil, beat.Info{Logger: logger}, false, fileset.FilesetOverrides{}, paths)
if err != nil {
return nil, err
}
Expand Down
12 changes: 7 additions & 5 deletions filebeat/autodiscover/builder/hints/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1205,12 +1205,13 @@ func TestGenerateHints(t *testing.T) {
t.Run(test.msg, func(t *testing.T) {
// Configure path for modules access
abs, _ := filepath.Abs("../../..")
require.NoError(t, paths.InitPaths(&paths.Path{
p := paths.New()
require.NoError(t, p.InitPaths(&paths.Path{
Home: abs,
}))

logger := logptest.NewTestingLogger(t, "")
l, err := NewLogHints(test.config, logger)
l, err := newLogHints(test.config, logger, p)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -1442,11 +1443,12 @@ func TestGenerateHintsWithPaths(t *testing.T) {

// Configure path for modules access
abs, _ := filepath.Abs("../../..")
require.NoError(t, paths.InitPaths(&paths.Path{
p := paths.New()
require.NoError(t, p.InitPaths(&paths.Path{
Home: abs,
}))
logger := logptest.NewTestingLogger(t, "")
l, err := NewLogHints(cfg, logger)
l, err := newLogHints(cfg, logger, p)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -1487,7 +1489,7 @@ func TestCreateConfigResolvesVariablesFromOptions(t *testing.T) {
"hints": mapstr.M{"logs": mapstr.M{"raw": `[{"type":"docker","containers":{"ids":["${data.container.id}"]},"password":"${PASSWORD}"}]`}},
}

l, err := NewLogHints(cfg, logptest.NewTestingLogger(t, ""))
l, err := newLogHints(cfg, logptest.NewTestingLogger(t, ""), paths.New())
require.NoError(t, err)
cfgs := l.CreateConfig(event, opts...)
require.Len(t, cfgs, 1)
Expand Down
1 change: 1 addition & 0 deletions filebeat/beater/filebeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ func (fb *Filebeat) Run(b *beat.Beat) error {
config.Autodiscover,
b.Keystore,
fb.logger,
b.Paths,
)
if err != nil {
return err
Expand Down
3 changes: 2 additions & 1 deletion heartbeat/autodiscover/builder/hints/monitors.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
conf "github.com/elastic/elastic-agent-libs/config"
"github.com/elastic/elastic-agent-libs/logp"
"github.com/elastic/elastic-agent-libs/mapstr"
"github.com/elastic/elastic-agent-libs/paths"
)

const (
Expand All @@ -55,7 +56,7 @@ func InitializeModule() {
}

// NewHeartbeatHints builds a heartbeat hints builder
func NewHeartbeatHints(cfg *conf.C, logger *logp.Logger) (autodiscover.Builder, error) {
func NewHeartbeatHints(cfg *conf.C, logger *logp.Logger, p *paths.Path) (autodiscover.Builder, error) {
config := defaultConfig()
err := cfg.Unpack(config)

Expand Down
10 changes: 1 addition & 9 deletions heartbeat/beater/heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@
if stConfig != nil {
// Note this, intentionally, blocks until connected to the trace endpoint
var err error
logp.L().Infof("Setting up sock tracer at %s (wait: %s)", stConfig.Path, stConfig.Wait)

Check failure on line 77 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

use of `logp.L` forbidden because "accept a *logp.Logger as a parameter instead of using the global logp.L()" (forbidigo)

Check failure on line 77 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

use of `logp.L` forbidden because "accept a *logp.Logger as a parameter instead of using the global logp.L()" (forbidigo)

Check failure on line 77 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (macos-latest)

use of `logp.L` forbidden because "accept a *logp.Logger as a parameter instead of using the global logp.L()" (forbidigo)
sockTrace, err := tracer.NewSockTracer(stConfig.Path, stConfig.Wait)
if err == nil {
trace = sockTrace
} else {
logp.L().Warnf("could not connect to socket trace at path %s after %s timeout: %v", stConfig.Path, stConfig.Wait, err)

Check failure on line 82 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

use of `logp.L` forbidden because "accept a *logp.Logger as a parameter instead of using the global logp.L()" (forbidigo)

Check failure on line 82 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

use of `logp.L` forbidden because "accept a *logp.Logger as a parameter instead of using the global logp.L()" (forbidigo)

Check failure on line 82 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (macos-latest)

use of `logp.L` forbidden because "accept a *logp.Logger as a parameter instead of using the global logp.L()" (forbidigo)
}
}

Expand All @@ -94,7 +94,7 @@
trace.Abort()
return nil, fmt.Errorf("run_once mode fatal error: %w", err)
} else {
logp.L().Warnf("skipping monitor state management: %v", err)

Check failure on line 97 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

use of `logp.L` forbidden because "accept a *logp.Logger as a parameter instead of using the global logp.L()" (forbidigo)

Check failure on line 97 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

use of `logp.L` forbidden because "accept a *logp.Logger as a parameter instead of using the global logp.L()" (forbidigo)

Check failure on line 97 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (macos-latest)

use of `logp.L` forbidden because "accept a *logp.Logger as a parameter instead of using the global logp.L()" (forbidigo)
}
} else {
replaceStateLoader(monitorstate.MakeESLoader(esClient, monitorstate.DefaultDataStreams, parsedConfig.RunFrom))
Expand Down Expand Up @@ -194,7 +194,7 @@
}
// Configure the beats Manager to start after all the reloadable hooks are initialized
// and shutdown when the function return.
if err := b.Manager.Start(); err != nil {

Check failure on line 197 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

SA1019: b.Manager.Start is deprecated: Use [PreInit] and [PostInit] instead (staticcheck)

Check failure on line 197 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

SA1019: b.Manager.Start is deprecated: Use [PreInit] and [PostInit] instead (staticcheck)

Check failure on line 197 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (macos-latest)

SA1019: b.Manager.Start is deprecated: Use [PreInit] and [PostInit] instead (staticcheck)
return err
}
defer b.Manager.Stop()
Expand Down Expand Up @@ -304,15 +304,7 @@

// makeAutodiscover creates an autodiscover object ready to be started.
func (bt *Heartbeat) makeAutodiscover(b *beat.Beat) (*autodiscover.Autodiscover, error) {
ad, err := autodiscover.NewAutodiscover(
"heartbeat",
b.Publisher,
bt.monitorFactory,
autodiscover.QueryConfig(),
bt.config.Autodiscover,
b.Keystore,
b.Info.Logger,
)
ad, err := autodiscover.NewAutodiscover("heartbeat", b.Publisher, bt.monitorFactory, autodiscover.QueryConfig(), bt.config.Autodiscover, b.Keystore, b.Info.Logger, nil)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -355,7 +347,7 @@

for i := 0; i < attempts; i++ {
// TODO: use local logger here
esClient, err = eslegclient.NewConnectedClient(ctx, newCfg, "Heartbeat", logp.NewLogger(""))

Check failure on line 350 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

use of `logp.NewLogger` forbidden because "accept a *logp.Logger as a parameter instead of creating one with logp.NewLogger" (forbidigo)

Check failure on line 350 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

use of `logp.NewLogger` forbidden because "accept a *logp.Logger as a parameter instead of creating one with logp.NewLogger" (forbidigo)

Check failure on line 350 in heartbeat/beater/heartbeat.go

View workflow job for this annotation

GitHub Actions / lint (macos-latest)

use of `logp.NewLogger` forbidden because "accept a *logp.Logger as a parameter instead of creating one with logp.NewLogger" (forbidigo)
if err == nil {
connectDelay.Reset()
return esClient, nil
Expand Down
13 changes: 3 additions & 10 deletions libbeat/autodiscover/autodiscover.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"github.com/elastic/elastic-agent-libs/keystore"
"github.com/elastic/elastic-agent-libs/logp"
"github.com/elastic/elastic-agent-libs/mapstr"
"github.com/elastic/elastic-agent-libs/paths"
)

const (
Expand Down Expand Up @@ -68,15 +69,7 @@ type Autodiscover struct {
}

// NewAutodiscover instantiates and returns a new Autodiscover manager
func NewAutodiscover(
name string,
pipeline beat.PipelineConnector,
factory cfgfile.RunnerFactory,
configurer EventConfigurer,
c *Config,
keystore keystore.Keystore,
logger *logp.Logger,
) (*Autodiscover, error) {
func NewAutodiscover(name string, pipeline beat.PipelineConnector, factory cfgfile.RunnerFactory, configurer EventConfigurer, c *Config, keystore keystore.Keystore, logger *logp.Logger, path *paths.Path) (*Autodiscover, error) {
logger = logger.Named("autodiscover")

// Init Event bus
Expand All @@ -85,7 +78,7 @@ func NewAutodiscover(
// Init providers
var providers []Provider
for _, providerCfg := range c.Providers {
provider, err := Registry.BuildProvider(name, bus, providerCfg, keystore)
provider, err := Registry.BuildProvider(name, bus, providerCfg, keystore, path)
if err != nil {
return nil, fmt.Errorf("error in autodiscover provider settings: %w", err)
}
Expand Down
34 changes: 18 additions & 16 deletions libbeat/autodiscover/autodiscover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"github.com/elastic/elastic-agent-libs/logp"
"github.com/elastic/elastic-agent-libs/logp/logptest"
"github.com/elastic/elastic-agent-libs/mapstr"
"github.com/elastic/elastic-agent-libs/paths"
)

type mockRunner struct {
Expand Down Expand Up @@ -181,7 +182,7 @@ func TestAutodiscover(t *testing.T) {
busChan := make(chan bus.Bus, 1)
Registry = NewRegistry()
err := Registry.AddProvider("mock",
func(beatName string, b bus.Bus, uuid uuid.UUID, c *conf.C, k keystore.Keystore, l *logp.Logger) (Provider, error) {
func(beatName string, b bus.Bus, uuid uuid.UUID, c *conf.C, k keystore.Keystore, l *logp.Logger, p *paths.Path) (Provider, error) {
// intercept bus to mock events
busChan <- b

Expand Down Expand Up @@ -209,7 +210,7 @@ func TestAutodiscover(t *testing.T) {
k, _ := keystore.NewFileKeystore("test")
// Create autodiscover manager
logger := logptest.NewTestingLogger(t, "")
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger)
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger, nil)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -333,7 +334,7 @@ func TestAutodiscoverHash(t *testing.T) {
busChan := make(chan bus.Bus, 1)

Registry = NewRegistry()
err := Registry.AddProvider("mock", func(beatName string, b bus.Bus, uuid uuid.UUID, c *conf.C, k keystore.Keystore, l *logp.Logger) (Provider, error) {
err := Registry.AddProvider("mock", func(beatName string, b bus.Bus, uuid uuid.UUID, c *conf.C, k keystore.Keystore, l *logp.Logger, p *paths.Path) (Provider, error) {
// intercept bus to mock events
busChan <- b

Expand Down Expand Up @@ -364,7 +365,7 @@ func TestAutodiscoverHash(t *testing.T) {
k, _ := keystore.NewFileKeystore("test")
logger := logptest.NewTestingLogger(t, "")
// Create autodiscover manager
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger)
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger, nil)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -402,7 +403,7 @@ func TestAutodiscoverDuplicatedConfigConfigCheckCalledOnce(t *testing.T) {
busChan := make(chan bus.Bus, 1)

Registry = NewRegistry()
err := Registry.AddProvider("mock", func(beatName string, b bus.Bus, uuid uuid.UUID, c *conf.C, k keystore.Keystore, l *logp.Logger) (Provider, error) {
err := Registry.AddProvider("mock", func(beatName string, b bus.Bus, uuid uuid.UUID, c *conf.C, k keystore.Keystore, l *logp.Logger, p *paths.Path) (Provider, error) {
// intercept bus to mock events
busChan <- b

Expand All @@ -429,7 +430,7 @@ func TestAutodiscoverDuplicatedConfigConfigCheckCalledOnce(t *testing.T) {
k, _ := keystore.NewFileKeystore("test")
logger := logptest.NewTestingLogger(t, "")
// Create autodiscover manager
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger)
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger, nil)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -467,7 +468,7 @@ func TestAutodiscoverWithConfigCheckFailures(t *testing.T) {
// Register mock autodiscover provider
busChan := make(chan bus.Bus, 1)
Registry = NewRegistry()
err := Registry.AddProvider("mock", func(beatName string, b bus.Bus, uuid uuid.UUID, c *conf.C, k keystore.Keystore, l *logp.Logger) (Provider, error) {
err := Registry.AddProvider("mock", func(beatName string, b bus.Bus, uuid uuid.UUID, c *conf.C, k keystore.Keystore, l *logp.Logger, p *paths.Path) (Provider, error) {
// intercept bus to mock events
busChan <- b

Expand Down Expand Up @@ -498,7 +499,7 @@ func TestAutodiscoverWithConfigCheckFailures(t *testing.T) {
k, _ := keystore.NewFileKeystore("test")
logger := logptest.NewTestingLogger(t, "")
// Create autodiscover manager
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger)
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger, nil)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -530,7 +531,7 @@ func TestAutodiscoverWithMutlipleEntries(t *testing.T) {
// Register mock autodiscover provider
busChan := make(chan bus.Bus, 1)
Registry = NewRegistry()
err := Registry.AddProvider("mock", func(beatName string, b bus.Bus, uuid uuid.UUID, c *conf.C, k keystore.Keystore, l *logp.Logger) (Provider, error) {
err := Registry.AddProvider("mock", func(beatName string, b bus.Bus, uuid uuid.UUID, c *conf.C, k keystore.Keystore, l *logp.Logger, p *paths.Path) (Provider, error) {
// intercept bus to mock events
busChan <- b

Expand Down Expand Up @@ -558,7 +559,7 @@ func TestAutodiscoverWithMutlipleEntries(t *testing.T) {
k, _ := keystore.NewFileKeystore("test")
logger := logptest.NewTestingLogger(t, "")
// Create autodiscover manager
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger)
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger, nil)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -653,7 +654,7 @@ func TestAutodiscoverDebounce(t *testing.T) {
// Register mock autodiscover provider
busChan := make(chan bus.Bus, 1)
Registry = NewRegistry()
err := Registry.AddProvider("mock", func(beatName string, b bus.Bus, uuid uuid.UUID, c *conf.C, k keystore.Keystore, l *logp.Logger) (Provider, error) {
err := Registry.AddProvider("mock", func(beatName string, b bus.Bus, uuid uuid.UUID, c *conf.C, k keystore.Keystore, l *logp.Logger, p *paths.Path) (Provider, error) {
// intercept bus to mock events
busChan <- b

Expand All @@ -674,7 +675,7 @@ func TestAutodiscoverDebounce(t *testing.T) {
adapter := mockAdapter{}
logger := logptest.NewTestingLogger(t, "")
// Create autodiscover manager
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger)
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger, nil)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -810,7 +811,8 @@ func TestErrNonReloadableIsNotRetried(t *testing.T) {
uuid uuid.UUID,
c *conf.C,
k keystore.Keystore,
l *logp.Logger) (Provider, error) {
l *logp.Logger,
p *paths.Path) (Provider, error) {

// intercept bus to mock events
busChan <- b
Expand Down Expand Up @@ -841,7 +843,7 @@ func TestErrNonReloadableIsNotRetried(t *testing.T) {
k, _ := keystore.NewFileKeystore(filepath.Join(t.TempDir(), "keystore"))
logger, observedLogs := logptest.NewTestingLoggerWithObserver(t, "")
// Create autodiscover manager
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger)
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger, nil)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -903,7 +905,7 @@ func TestAutodiscoverMetadataCleanup(t *testing.T) {

busChan := make(chan bus.Bus, 1)
Registry = NewRegistry()
err := Registry.AddProvider("mock", func(beatName string, b bus.Bus, uuid uuid.UUID, c *conf.C, k keystore.Keystore, l *logp.Logger) (Provider, error) {
err := Registry.AddProvider("mock", func(beatName string, b bus.Bus, uuid uuid.UUID, c *conf.C, k keystore.Keystore, l *logp.Logger, p *paths.Path) (Provider, error) {
busChan <- b
return &mockProvider{}, nil
})
Expand All @@ -919,7 +921,7 @@ func TestAutodiscoverMetadataCleanup(t *testing.T) {
k, _ := keystore.NewFileKeystore("test")
logger := logptest.NewTestingLogger(t, "")

autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger)
autodiscover, err := NewAutodiscover("test", nil, &adapter, &adapter, &config, k, logger, nil)
require.NoError(t, err)

autodiscover.debouncePeriod = 50 * time.Millisecond
Expand Down
10 changes: 6 additions & 4 deletions libbeat/autodiscover/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/elastic/elastic-agent-libs/config"
"github.com/elastic/elastic-agent-libs/keystore"
"github.com/elastic/elastic-agent-libs/logp"
"github.com/elastic/elastic-agent-libs/paths"
"github.com/elastic/go-ucfg"
)

Expand All @@ -43,7 +44,7 @@ type Builders struct {
}

// BuilderConstructor is a func used to generate a Builder object
type BuilderConstructor func(c *config.C, logger *logp.Logger) (Builder, error)
type BuilderConstructor func(c *config.C, logger *logp.Logger, paths *paths.Path) (Builder, error)

// AddBuilder registers a new BuilderConstructor
func (r *registry) AddBuilder(name string, builder BuilderConstructor) error {
Expand Down Expand Up @@ -78,7 +79,7 @@ func (r *registry) GetBuilder(name string) BuilderConstructor {
}

// BuildBuilder reads provider configuration and instantiate one
func (r *registry) BuildBuilder(c *config.C) (Builder, error) {
func (r *registry) BuildBuilder(c *config.C, paths *paths.Path) (Builder, error) {
var config BuilderConfig
err := c.Unpack(&config)
if err != nil {
Expand All @@ -90,7 +91,7 @@ func (r *registry) BuildBuilder(c *config.C) (Builder, error) {
return nil, fmt.Errorf("unknown autodiscover builder %s", config.Type)
}

return builder(c, r.logger)
return builder(c, r.logger, paths)
}

// GetConfig creates configs for all builders initialized.
Expand Down Expand Up @@ -121,6 +122,7 @@ func NewBuilders(
bConfigs []*config.C,
hintsCfg *config.C,
keystoreProvider bus.KeystoreProvider,
paths *paths.Path,
) (Builders, error) {
var builders Builders
if hintsCfg.Enabled() {
Expand All @@ -137,7 +139,7 @@ func NewBuilders(
}

for _, bcfg := range bConfigs {
builder, err := Registry.BuildBuilder(bcfg)
builder, err := Registry.BuildBuilder(bcfg, paths)
if err != nil {
return Builders{}, err
}
Expand Down
5 changes: 3 additions & 2 deletions libbeat/autodiscover/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/elastic/elastic-agent-autodiscover/bus"
conf "github.com/elastic/elastic-agent-libs/config"
"github.com/elastic/elastic-agent-libs/logp"
"github.com/elastic/elastic-agent-libs/paths"
"github.com/elastic/go-ucfg"
)

Expand All @@ -35,7 +36,7 @@ func (f *fakeBuilder) CreateConfig(event bus.Event, options ...ucfg.Option) []*c
return []*conf.C{conf.NewConfig()}
}

func newFakeBuilder(_ *conf.C, logger *logp.Logger) (Builder, error) {
func newFakeBuilder(_ *conf.C, logger *logp.Logger, _ *paths.Path) (Builder, error) {
return &fakeBuilder{}, nil
}

Expand All @@ -59,7 +60,7 @@ func TestBuilderRegistry(t *testing.T) {
// Make sure that config building doesn't fail
assert.NoError(t, err)

builder, err := reg.BuildBuilder(cfg)
builder, err := reg.BuildBuilder(cfg, nil)
assert.NoError(t, err)
assert.NotNil(t, builder)

Expand Down
Loading
Loading