api: more accurately document required fields (#9443)

Modifies the protodoc tool to tag required duration fields as required.
Adds documentation around HttpHealthCheck.expected_statuses to clarify
what's expected of the Int64Range. Tags two Uint32Value fields as required
since they were implicitly treated as such (and generated missing field
exceptions when unset).

Risk Level: low
Testing: existing tests pass
Docs Changes: yes
Release Notes: n/a

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

Mirrored from https://github.com/envoyproxy/envoy @ 9263763e0a68961ee10fe63bc534d2546ed38376
master-ci-test
data-plane-api(CircleCI) 5 years ago
parent b2f681e9be
commit cd2771b8bb
  1. 7
      envoy/api/v2/core/health_check.proto
  2. 7
      envoy/api/v3alpha/core/health_check.proto

@ -103,7 +103,8 @@ message HealthCheck {
// Specifies a list of HTTP response statuses considered healthy. If provided, replaces default
// 200-only policy - 200 must be included explicitly as needed. Ranges follow half-open
// semantics of :ref:`Int64Range <envoy_api_msg_type.Int64Range>`.
// semantics of :ref:`Int64Range <envoy_api_msg_type.Int64Range>`. The start and end of each
// range are required. Only statuses in the range [100, 600) are allowed.
repeated type.Int64Range expected_statuses = 9;
// Use specified application protocol for health checks. This is to replace
@ -198,12 +199,12 @@ message HealthCheck {
// The number of unhealthy health checks required before a host is marked
// unhealthy. Note that for *http* health checking if a host responds with 503
// this threshold is ignored and the host is considered unhealthy immediately.
google.protobuf.UInt32Value unhealthy_threshold = 4;
google.protobuf.UInt32Value unhealthy_threshold = 4 [(validate.rules).message = {required: true}];
// The number of healthy health checks required before a host is marked
// healthy. Note that during startup, only a single successful health check is
// required to mark a host healthy.
google.protobuf.UInt32Value healthy_threshold = 5;
google.protobuf.UInt32Value healthy_threshold = 5 [(validate.rules).message = {required: true}];
// [#not-implemented-hide:] Non-serving port for health checking.
google.protobuf.UInt32Value alt_port = 6;

@ -112,7 +112,8 @@ message HealthCheck {
// Specifies a list of HTTP response statuses considered healthy. If provided, replaces default
// 200-only policy - 200 must be included explicitly as needed. Ranges follow half-open
// semantics of :ref:`Int64Range <envoy_api_msg_type.v3alpha.Int64Range>`.
// semantics of :ref:`Int64Range <envoy_api_msg_type.v3alpha.Int64Range>`. The start and end of
// each range are required. Only statuses in the range [100, 600) are allowed.
repeated type.v3alpha.Int64Range expected_statuses = 9;
// Use specified application protocol for health checks. This is to replace
@ -222,12 +223,12 @@ message HealthCheck {
// The number of unhealthy health checks required before a host is marked
// unhealthy. Note that for *http* health checking if a host responds with 503
// this threshold is ignored and the host is considered unhealthy immediately.
google.protobuf.UInt32Value unhealthy_threshold = 4;
google.protobuf.UInt32Value unhealthy_threshold = 4 [(validate.rules).message = {required: true}];
// The number of healthy health checks required before a host is marked
// healthy. Note that during startup, only a single successful health check is
// required to mark a host healthy.
google.protobuf.UInt32Value healthy_threshold = 5;
google.protobuf.UInt32Value healthy_threshold = 5 [(validate.rules).message = {required: true}];
// [#not-implemented-hide:] Non-serving port for health checking.
google.protobuf.UInt32Value alt_port = 6;

Loading…
Cancel
Save