retry: validate retry previous priorities config (#9348)

Setting update_frequency to 0 causes a segfault. Prevent invalid values via validation.

Risk Level: low
Testing: added unit test
Doc Changes: updated
Release Notes: n/a

Signed-off-by: Stephan Zuercher <zuercher@gmail.com>

Mirrored from https://github.com/envoyproxy/envoy @ 3256d60fcb9710f0ffda856e72126fd957796409
master-ci-test
data-plane-api(CircleCI) 5 years ago
parent e2b629561a
commit 5e4c38ad4c
  1. 6
      envoy/config/retry/previous_priorities/previous_priorities_config.proto

@ -6,6 +6,8 @@ option java_package = "io.envoyproxy.envoy.config.retry.previous_priorities";
option java_outer_classname = "PreviousPrioritiesConfigProto";
option java_multiple_files = true;
import "validate/validate.proto";
// A retry host selector that attempts to spread retries between priorities, even if certain
// priorities would not normally be attempted due to higher priorities being available.
//
@ -41,5 +43,7 @@ message PreviousPrioritiesConfig {
// load which excludes the priorities routed to with the first two attempts, and the fifth and
// sixth attempt will use the priority load excluding the priorities used for the first four
// attempts.
int32 update_frequency = 1;
//
// Must be greater than 0.
int32 update_frequency = 1 [(validate.rules).int32 = {gt: 0}];
}

Loading…
Cancel
Save