Skip to content

Commit

Permalink
fix(MeshGateway): cross-mesh gateways with same service
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Beaumont <mjboamail@gmail.com>
  • Loading branch information
michaelbeaumont committed Nov 2, 2022
1 parent 9b2c753 commit 2b7053c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/xds/generator/outbound_proxy_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,15 @@ func (OutboundProxyGenerator) determineRoutes(
isExternalService = true
}

allTags := envoy_common.Tags(destination.Destination)
cluster := envoy_common.NewCluster(
envoy_common.WithService(service),
envoy_common.WithName(name),
envoy_common.WithWeight(destination.GetWeight().GetValue()),
// The mesh tag is set here if this destination is generated
// from a MeshGateway virtual outbound and is not part of the
// service tags
envoy_common.WithTags(envoy_common.Tags(destination.Destination).WithoutTags(mesh_proto.MeshTag)),
envoy_common.WithTags(allTags.WithoutTags(mesh_proto.MeshTag)),
envoy_common.WithTimeout(timeoutConf),
envoy_common.WithLB(route.Spec.GetConf().GetLoadBalancer()),
envoy_common.WithExternalService(isExternalService),
Expand All @@ -392,10 +393,10 @@ func (OutboundProxyGenerator) determineRoutes(
cluster.SetMesh(mesh)
}

if name, ok := clusterCache[cluster.Tags().String()]; ok {
if name, ok := clusterCache[allTags.String()]; ok {
cluster.SetName(name)
} else {
clusterCache[cluster.Tags().String()] = cluster.Name()
clusterCache[allTags.String()] = cluster.Name()
}

if isExternalService {
Expand Down

0 comments on commit 2b7053c

Please sign in to comment.