From f7cfd4b8a4f9a1cef88b6e383d4790d03427a179 Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Fri, 14 Jun 2019 04:12:33 +0000 Subject: [PATCH] upstream: Fallback policy per selector support (#7087) This code change allows to redefine fallback policy per specific subset selector. Because of how existing LbSubsetMap trie data structure is organised (mapping subset key to values), is not possible to do lookups for fallback policy only based on subset keys (had to introduce additional trie that maps subset keys to keys and has fallback policy on leaf level). Additional LbSubsetSelectorFallbackPolicy enum required to correctly identify the case when fallback policy is not set for given selector (otherwise it would always default to NO_FALLBACK, breaking backwards compatibility, if field is not set we should use top level fallback policy instead). Risk Level: Medium Testing: Done Docs Changes: Updated related docs Release Notes: added Fixes #5130 Signed-off-by: Kateryna Nezdolii Mirrored from https://github.com/envoyproxy/envoy @ 1a60b343665cf2ffb966f37bbe48fed21805df57 --- envoy/api/v2/cds.proto | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/envoy/api/v2/cds.proto b/envoy/api/v2/cds.proto index 63321881..4f79fda5 100644 --- a/envoy/api/v2/cds.proto +++ b/envoy/api/v2/cds.proto @@ -367,6 +367,24 @@ message Cluster { message LbSubsetSelector { // List of keys to match with the weighted cluster metadata. repeated string keys = 1; + // The behavior used when no endpoint subset matches the selected route's + // metadata. + LbSubsetSelectorFallbackPolicy fallback_policy = 2 + [(validate.rules).enum.defined_only = true]; + + // Allows to override top level fallback policy per selector. + enum LbSubsetSelectorFallbackPolicy { + // If NOT_DEFINED top level config fallback policy is used instead. + NOT_DEFINED = 0; + // If NO_FALLBACK is selected, a result equivalent to no healthy hosts is reported. + NO_FALLBACK = 1; + // If ANY_ENDPOINT is selected, any cluster endpoint may be returned + // (subject to policy, health checks, etc). + ANY_ENDPOINT = 2; + // If DEFAULT_SUBSET is selected, load balancing is performed over the + // endpoints matching the values from the default_subset field. + DEFAULT_SUBSET = 3; + } } // For each entry, LbEndpoint.Metadata's