Skip to content

Commit

Permalink
fix(MeshService): don't skip endpoints for headless (#10684)
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Beaumont <mjboamail@gmail.com>
  • Loading branch information
michaelbeaumont authored Jul 1, 2024
1 parent 5425d12 commit 9f68d20
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
4 changes: 0 additions & 4 deletions pkg/xds/topology/outbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,6 @@ func fillLocalMeshServices(
continue
}

if meshSvc.Spec.Selector.DataplaneRef != nil {
continue
}

for _, dpp := range dpps {
dpNetworking := dpp.Spec.GetNetworking()
for _, inbound := range dpNetworking.GetHealthyInbounds() {
Expand Down
30 changes: 29 additions & 1 deletion pkg/xds/topology/outbound_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ var _ = Describe("TrafficRoute", func() {
},
dataplanes: []*core_mesh.DataplaneResource{
{
Meta: &test_model.ResourceMeta{Mesh: defaultMeshName},
Meta: &test_model.ResourceMeta{Mesh: defaultMeshName, Name: "redis-0"},
Spec: &mesh_proto.Dataplane{
Networking: &mesh_proto.Dataplane_Networking{
Address: "192.168.0.1",
Expand Down Expand Up @@ -1248,6 +1248,25 @@ var _ = Describe("TrafficRoute", func() {
},
},
},
{
Meta: &test_model.ResourceMeta{
Mesh: "default",
Name: "redis-0",
},
Spec: &v1alpha1.MeshService{
Selector: v1alpha1.Selector{
DataplaneRef: &v1alpha1.DataplaneRef{
Name: "redis-0",
},
},
Ports: []v1alpha1.Port{
{
Port: 6379,
TargetPort: intstr.FromInt(6379),
},
},
},
},
},
mesh: defaultMeshWithMTLS,
expected: core_xds.EndpointMap{
Expand All @@ -1260,6 +1279,15 @@ var _ = Describe("TrafficRoute", func() {
Weight: 1,
},
},
"redis-0_svc_6379": []core_xds.Endpoint{
{
Target: "192.168.0.1",
Port: 6379,
Tags: map[string]string{mesh_proto.ServiceTag: "redis_svc_6379", "version": "v1"},
Locality: nil,
Weight: 1,
},
},
"kong_kong-system_svc_80": []core_xds.Endpoint{
{
Target: "192.168.0.2",
Expand Down

0 comments on commit 9f68d20

Please sign in to comment.