hds: group endpoint health response by cluster and locality (#12452)

Currently, the health discovery service takes a specifier with information about which endpoints to perform health checks on, which already supports information about cluster structure and locality information. However, when when forming a response holding endpoint health information, all notion of cluster or locality is dropped and endpoint information is stored in a flat list. This is problematic when there are several endpoints with the same address or port but with a different locality, cluster, or path.

This PR uses the previous proto change in Issue #12153 which added support for grouping endpoint health information by their respective cluster and locality.

Risk Level: Low
Testing: Added a unit test in test/common/upstream/hds_test, which sends a specifier to HdsDelegate with several clusters, localties, and endpoints. It then verifies that the response holds the same structure. Existing integration tests were also changed to check for the new proto structure, specifically ones that already group several endpoints by differing clusters or localities.

Signed-off-by: Drew S. Ortega <drewortega@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ d16164be1bd0ec7eba2b0b0f78ae8b0f455acd50
master-ci-test
data-plane-api(CircleCI) 4 years ago
parent 5f5280738e
commit a89e7e0ace
  1. 4
      envoy/service/health/v3/hds.proto
  2. 7
      envoy/service/health/v4alpha/hds.proto

@ -128,11 +128,9 @@ message EndpointHealthResponse {
option (udpa.annotations.versioning).previous_message_type =
"envoy.service.discovery.v2.EndpointHealthResponse";
// [#comment:TODO(drewsortega): add deprecate annotation once cluster_endpoints_health is implemented]
// Deprecated - Flat list of endpoint health information.
repeated EndpointHealth endpoints_health = 1;
repeated EndpointHealth endpoints_health = 1 [deprecated = true];
// [#not-implemented-hide:]
// Organize Endpoint health information by cluster.
repeated ClusterEndpointsHealth cluster_endpoints_health = 2;
}

@ -132,11 +132,10 @@ message EndpointHealthResponse {
option (udpa.annotations.versioning).previous_message_type =
"envoy.service.health.v3.EndpointHealthResponse";
// [#comment:TODO(drewsortega): add deprecate annotation once cluster_endpoints_health is implemented]
// Deprecated - Flat list of endpoint health information.
repeated EndpointHealth endpoints_health = 1;
reserved 1;
reserved "endpoints_health";
// [#not-implemented-hide:]
// Organize Endpoint health information by cluster.
repeated ClusterEndpointsHealth cluster_endpoints_health = 2;
}

Loading…
Cancel
Save