weighted-clusters: validate that total sum of weights below max int (#24986)

Adds additional validation that the sum of weights of weighted clusters in a route does not exceed max uint32.

Risk Level: low - although this is a new validation, previously there was a similar validation when total_weight was used.
Testing: Added unit test

Signed-off-by: Adi Suissa-Peleg <adip@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ 0a2f59240b4b005be0a9a5824c5e6c1604028d86
pull/626/head
data-plane-api(Azure Pipelines) 2 years ago
parent c5f3a6e900
commit ac99b90241
  1. 3
      envoy/config/route/v3/route_components.proto

@ -408,7 +408,8 @@ message WeightedCluster {
// The weight of the cluster. This value is relative to the other clusters'
// weights. When a request matches the route, the choice of an upstream cluster
// is determined by its weight. The sum of weights across all
// entries in the clusters array must be greater than 0.
// entries in the clusters array must be greater than 0, and must not exceed
// uint32_t maximal value (4294967295).
google.protobuf.UInt32Value weight = 2;
// Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints in

Loading…
Cancel
Save