Skip to content

Commit

Permalink
eds: Remove unused variables and inline usage of meshCatalog.ListAllo…
Browse files Browse the repository at this point in the history
…wedOutboundServicesForIdentity() in for loop (openservicemesh#2259)

Signed-off-by: Delyan Raychev <delyan.raychev@microsoft.com>
  • Loading branch information
draychev authored Jan 6, 2021
1 parent f7bdec7 commit cf3ebf1
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pkg/envoy/eds/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,9 @@ func NewResponse(meshCatalog catalog.MeshCataloger, proxy *envoy.Proxy, _ *xds_d
log.Error().Err(err).Msgf("Error looking up proxy identity for proxy with CN=%q", proxy.GetCommonName())
return nil, err
}
outboundServices := meshCatalog.ListAllowedOutboundServicesForIdentity(proxyIdentity)
if err != nil {
log.Error().Err(err).Msgf("Error listing outbound services for proxy %q", proxyServiceName)
return nil, err
}

outboundServicesEndpoints := make(map[service.MeshService][]endpoint.Endpoint)
for _, dstSvc := range outboundServices {
for _, dstSvc := range meshCatalog.ListAllowedOutboundServicesForIdentity(proxyIdentity) {
endpoints, err := meshCatalog.ListEndpointsForService(dstSvc)
if err != nil {
log.Error().Err(err).Msgf("Failed listing endpoints for service %s", dstSvc)
Expand Down

0 comments on commit cf3ebf1

Please sign in to comment.