add a check on the error
@@ -324,7 +324,10 @@ func (srv *networkServiceManager) getEndpoint(ctx context.Context, networkServic
endpoints, err := discovery.FindNetworkService(span.Context(), &registry.FindNetworkServiceRequest{
NetworkServiceName: networkServiceName,
})
+ if err != nil {
span.LogError(err)
+ return endpoint
+ }
for _, ep := range endpoints.NetworkServiceEndpoints {
if xcon.GetRemoteDestination() != nil && ep.GetName() == xcon.GetRemoteDestination().GetNetworkServiceEndpointName() {
endpoint = &registry.NSERegistration{
