From f68c6ac111b36f6b9315972e80c805cbf272c1e8 Mon Sep 17 00:00:00 2001 From: Dmitry Anoshin Date: Tue, 13 Feb 2024 15:14:06 -0800 Subject: [PATCH] [config/configgrpc] [chore] Remove usage of deprecated ToListenerContext --- config/configgrpc/configgrpc_test.go | 8 ++++---- receiver/otlpreceiver/otlp.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/configgrpc/configgrpc_test.go b/config/configgrpc/configgrpc_test.go index 913ac06d206..0887b88834a 100644 --- a/config/configgrpc/configgrpc_test.go +++ b/config/configgrpc/configgrpc_test.go @@ -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", }, @@ -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) @@ -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) @@ -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() { diff --git a/receiver/otlpreceiver/otlp.go b/receiver/otlpreceiver/otlp.go index da94a6eca71..a31895de054 100644 --- a/receiver/otlpreceiver/otlp.go +++ b/receiver/otlpreceiver/otlp.go @@ -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 }