Skip to content

Commit

Permalink
[config/configgrpc] [chore] Remove usage of deprecated ToListenerCont…
Browse files Browse the repository at this point in the history
…ext (#9582)

Not sure why the linter doesn't catch it
  • Loading branch information
dmitryax authored Feb 22, 2024
1 parent bdcdff4 commit 1ce9c93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions config/configgrpc/configgrpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ func TestGRPCServerSettingsError(t *testing.T) {

func TestGRPCServerSettings_ToListener_Error(t *testing.T) {
settings := ServerConfig{
NetAddr: confignet.AddrConfig{
NetAddr: confignet.NetAddr{
Endpoint: "127.0.0.1:1234567",
Transport: "tcp",
},
Expand Down Expand Up @@ -622,7 +622,7 @@ func TestHttpReception(t *testing.T) {
},
TLSSetting: test.tlsServerCreds,
}
ln, err := gss.ToListenerContext(context.Background())
ln, err := gss.NetAddr.Listen(context.Background())
assert.NoError(t, err)
s, err := gss.ToServer(componenttest.NewNopHost(), componenttest.NewNopTelemetrySettings())
assert.NoError(t, err)
Expand Down Expand Up @@ -669,7 +669,7 @@ func TestReceiveOnUnixDomainSocket(t *testing.T) {
Transport: "unix",
},
}
ln, err := gss.ToListenerContext(context.Background())
ln, err := gss.NetAddr.Listen(context.Background())
assert.NoError(t, err)
srv, err := gss.ToServer(componenttest.NewNopHost(), componenttest.NewNopTelemetrySettings())
assert.NoError(t, err)
Expand Down Expand Up @@ -871,7 +871,7 @@ func TestClientInfoInterceptors(t *testing.T) {

defer srv.Stop()

l, err = gss.ToListenerContext(context.Background())
l, err = gss.NetAddr.Listen(context.Background())
require.NoError(t, err)

go func() {
Expand Down
2 changes: 1 addition & 1 deletion receiver/otlpreceiver/otlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (r *otlpReceiver) startGRPCServer(host component.Host) error {

r.settings.Logger.Info("Starting GRPC server", zap.String("endpoint", r.cfg.GRPC.NetAddr.Endpoint))
var gln net.Listener
if gln, err = r.cfg.GRPC.ToListenerContext(context.Background()); err != nil {
if gln, err = r.cfg.GRPC.NetAddr.Listen(context.Background()); err != nil {
return err
}

Expand Down

0 comments on commit 1ce9c93

Please sign in to comment.