mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
@@ -171,17 +171,19 @@ func TestTrafficLocality(t *testing.T) {
|
|||||||
{
|
{
|
||||||
cla: &xdspb.ClusterLoadAssignment{
|
cla: &xdspb.ClusterLoadAssignment{
|
||||||
ClusterName: "web",
|
ClusterName: "web",
|
||||||
Endpoints: append(endpointsWithLocality([]EndpointHealth{
|
Endpoints: append(
|
||||||
{"127.0.0.1", 18008, corepb.HealthStatus_HEALTHY},
|
endpointsWithLocality([]EndpointHealth{
|
||||||
{"127.0.0.2", 18008, corepb.HealthStatus_HEALTHY}},
|
{"127.0.0.1", 18008, corepb.HealthStatus_HEALTHY},
|
||||||
xds.Locality{Region: "us"}),
|
{"127.0.0.2", 18008, corepb.HealthStatus_HEALTHY}},
|
||||||
|
xds.Locality{Region: "us"}),
|
||||||
endpointsWithLocality([]EndpointHealth{
|
endpointsWithLocality([]EndpointHealth{
|
||||||
{"127.0.1.1", 18008, corepb.HealthStatus_HEALTHY},
|
{"127.0.1.1", 18008, corepb.HealthStatus_HEALTHY},
|
||||||
{"127.0.1.2", 18008, corepb.HealthStatus_HEALTHY}},
|
{"127.0.1.2", 18008, corepb.HealthStatus_HEALTHY}},
|
||||||
xds.Locality{Region: "eu"})...),
|
xds.Locality{Region: "eu"})...,
|
||||||
|
),
|
||||||
},
|
},
|
||||||
cluster: "web", qtype: dns.TypeA, rcode: dns.RcodeSuccess, answer: 2,
|
cluster: "web", qtype: dns.TypeA, rcode: dns.RcodeSuccess, answer: 2,
|
||||||
loc: xds.Locality{Region: "eu"},
|
loc: xds.Locality{Region: "eu"}, // our location
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user