Skip to content

Commit

Permalink
[tagger/remote] Make constructor private (DataDog#31602)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidor authored Nov 29, 2024
1 parent 0e9db52 commit 96c83b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions comp/core/tagger/impl-remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ type Options struct {

// NewComponent returns a remote tagger
func NewComponent(req Requires) (Provides, error) {
remoteTagger, err := NewRemoteTagger(req.Params, req.Config, req.Log, req.Telemetry)
remoteTagger, err := newRemoteTagger(req.Params, req.Config, req.Log, req.Telemetry)

if err != nil {
return Provides{}, err
Expand All @@ -116,9 +116,7 @@ func NewComponent(req Requires) (Provides, error) {
}, nil
}

// NewRemoteTagger creates a new remote tagger.
// TODO: (components) remove once we pass the remote tagger instance to pkg/security/resolvers/tags/resolver.go
func NewRemoteTagger(params tagger.RemoteParams, cfg config.Component, log log.Component, telemetryComp coretelemetry.Component) (tagger.Component, error) {
func newRemoteTagger(params tagger.RemoteParams, cfg config.Component, log log.Component, telemetryComp coretelemetry.Component) (tagger.Component, error) {
telemetryStore := telemetry.NewStore(telemetryComp)

target, err := params.RemoteTarget(cfg)
Expand Down
4 changes: 2 additions & 2 deletions comp/core/tagger/impl-remote/remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestStart(t *testing.T) {
log := logmock.New(t)
telemetry := nooptelemetry.GetCompatComponent()

remoteTagger, err := NewRemoteTagger(params, cfg, log, telemetry)
remoteTagger, err := newRemoteTagger(params, cfg, log, telemetry)
require.NoError(t, err)
err = remoteTagger.Start(context.TODO())
require.NoError(t, err)
Expand All @@ -61,7 +61,7 @@ func TestStartDoNotBlockIfServerIsNotAvailable(t *testing.T) {
log := logmock.New(t)
telemetry := nooptelemetry.GetCompatComponent()

remoteTagger, err := NewRemoteTagger(params, cfg, log, telemetry)
remoteTagger, err := newRemoteTagger(params, cfg, log, telemetry)
require.NoError(t, err)
err = remoteTagger.Start(context.TODO())
require.NoError(t, err)
Expand Down

0 comments on commit 96c83b8

Please sign in to comment.