Skip to content

Commit a85a9b1

Browse files
author
Łukasz Dziedziak
authored
Update api to v1 17 (#159)
* Update protobuf to envoy 1.17 Signed-off-by: Lukasz Dziedziak <[email protected]> * Use v2 version Signed-off-by: Lukasz Dziedziak <[email protected]> * Support V2/V3 in Envoy - remove V2 in separate PR Signed-off-by: Lukasz Dziedziak <[email protected]> * UDPA download - split directory create/copy Signed-off-by: Lukasz Dziedziak <[email protected]>
1 parent f58b198 commit a85a9b1

File tree

107 files changed

+3450
-644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+3450
-644
lines changed

api/src/main/proto/envoy/api/v2/cluster.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ message Cluster {
352352
// This header isn't sanitized by default, so enabling this feature allows HTTP clients to
353353
// route traffic to arbitrary hosts and/or ports, which may have serious security
354354
// consequences.
355+
//
356+
// .. note::
357+
//
358+
// If the header appears multiple times only the first value is used.
355359
bool use_http_header = 1;
356360
}
357361

api/src/main/proto/envoy/api/v2/core/config_source.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ enum ApiVersion {
2626
// When not specified, we assume v2, to ease migration to Envoy's stable API
2727
// versioning. If a client does not support v2 (e.g. due to deprecation), this
2828
// is an invalid value.
29-
AUTO = 0;
29+
AUTO = 0 [deprecated = true];
3030

3131
// Use xDS v2 API.
32-
V2 = 1;
32+
V2 = 1 [deprecated = true];
3333

3434
// Use xDS v3 API.
3535
V3 = 2;

api/src/main/proto/envoy/api/v2/route/route_components.proto

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,10 @@ message RouteAction {
756756
//
757757
// Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1
758758
// *Host* header. Thus, if attempting to match on *Host*, match on *:authority* instead.
759+
//
760+
// .. note::
761+
//
762+
// If the header appears multiple times only the first value is used.
759763
string cluster_header = 2
760764
[(validate.rules).string = {min_bytes: 1 well_known_regex: HTTP_HEADER_NAME strict: false}];
761765

@@ -866,6 +870,10 @@ message RouteAction {
866870
//
867871
// Pay attention to the potential security implications of using this option. Provided header
868872
// must come from trusted source.
873+
//
874+
// .. note::
875+
//
876+
// If the header appears multiple times only the first value is used.
869877
string auto_host_rewrite_header = 29 [
870878
(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false},
871879
(udpa.annotations.field_migrate).rename = "host_rewrite_header"
@@ -1125,13 +1133,18 @@ message HedgePolicy {
11251133
// [#not-implemented-hide:]
11261134
type.FractionalPercent additional_request_chance = 2;
11271135

1128-
// Indicates that a hedged request should be sent when the per-try timeout
1129-
// is hit. This will only occur if the retry policy also indicates that a
1130-
// timed out request should be retried.
1131-
// Once a timed out request is retried due to per try timeout, the router
1132-
// filter will ensure that it is not retried again even if the returned
1133-
// response headers would otherwise be retried according the specified
1134-
// :ref:`RetryPolicy <envoy_api_msg_route.RetryPolicy>`.
1136+
// Indicates that a hedged request should be sent when the per-try timeout is hit.
1137+
// This means that a retry will be issued without resetting the original request, leaving multiple upstream requests in flight.
1138+
// The first request to complete successfully will be the one returned to the caller.
1139+
//
1140+
// * At any time, a successful response (i.e. not triggering any of the retry-on conditions) would be returned to the client.
1141+
// * Before per-try timeout, an error response (per retry-on conditions) would be retried immediately or returned ot the client
1142+
// if there are no more retries left.
1143+
// * After per-try timeout, an error response would be discarded, as a retry in the form of a hedged request is already in progress.
1144+
//
1145+
// Note: For this to have effect, you must have a :ref:`RetryPolicy <envoy_api_msg_route.RetryPolicy>` that retries at least
1146+
// one error code and specifies a maximum number of retries.
1147+
//
11351148
// Defaults to false.
11361149
bool hedge_on_per_try_timeout = 3;
11371150
}

api/src/main/proto/envoy/config/accesslog/v4alpha/accesslog.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ message AccessLog {
4747
// #. "envoy.access_loggers.file": :ref:`FileAccessLog
4848
// <envoy_api_msg_extensions.access_loggers.file.v4alpha.FileAccessLog>`
4949
// #. "envoy.access_loggers.http_grpc": :ref:`HttpGrpcAccessLogConfig
50-
// <envoy_api_msg_extensions.access_loggers.grpc.v3.HttpGrpcAccessLogConfig>`
50+
// <envoy_api_msg_extensions.access_loggers.grpc.v4alpha.HttpGrpcAccessLogConfig>`
5151
// #. "envoy.access_loggers.tcp_grpc": :ref:`TcpGrpcAccessLogConfig
52-
// <envoy_api_msg_extensions.access_loggers.grpc.v3.TcpGrpcAccessLogConfig>`
52+
// <envoy_api_msg_extensions.access_loggers.grpc.v4alpha.TcpGrpcAccessLogConfig>`
5353
oneof config_type {
5454
google.protobuf.Any typed_config = 4;
5555
}

api/src/main/proto/envoy/config/bootstrap/v3/bootstrap.proto

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import "google/protobuf/duration.proto";
2020
import "google/protobuf/struct.proto";
2121
import "google/protobuf/wrappers.proto";
2222

23-
import "udpa/core/v1/resource_locator.proto";
24-
2523
import "envoy/annotations/deprecation.proto";
2624
import "udpa/annotations/migrate.proto";
2725
import "udpa/annotations/security.proto";
@@ -40,7 +38,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
4038
// <config_overview_bootstrap>` for more detail.
4139

4240
// Bootstrap :ref:`configuration overview <config_overview_bootstrap>`.
43-
// [#next-free-field: 28]
41+
// [#next-free-field: 30]
4442
message Bootstrap {
4543
option (udpa.annotations.versioning).previous_message_type =
4644
"envoy.config.bootstrap.v2.Bootstrap";
@@ -77,18 +75,18 @@ message Bootstrap {
7775
// :ref:`LDS <arch_overview_dynamic_config_lds>` configuration source.
7876
core.v3.ConfigSource lds_config = 1;
7977

80-
// Resource locator for listener collection.
78+
// xdstp:// resource locator for listener collection.
8179
// [#not-implemented-hide:]
82-
udpa.core.v1.ResourceLocator lds_resources_locator = 5;
80+
string lds_resources_locator = 5;
8381

8482
// All post-bootstrap :ref:`Cluster <envoy_api_msg_config.cluster.v3.Cluster>` definitions are
8583
// provided by a single :ref:`CDS <arch_overview_dynamic_config_cds>`
8684
// configuration source.
8785
core.v3.ConfigSource cds_config = 2;
8886

89-
// Resource locator for cluster collection.
87+
// xdstp:// resource locator for cluster collection.
9088
// [#not-implemented-hide:]
91-
udpa.core.v1.ResourceLocator cds_resources_locator = 6;
89+
string cds_resources_locator = 6;
9290

9391
// A single :ref:`ADS <config_overview_ads>` source may be optionally
9492
// specified. This must have :ref:`api_type
@@ -110,7 +108,7 @@ message Bootstrap {
110108

111109
// A list of :ref:`Node <envoy_v3_api_msg_config.core.v3.Node>` field names
112110
// that will be included in the context parameters of the effective
113-
// *UdpaResourceLocator* that is sent in a discovery request when resource
111+
// xdstp:// URL that is sent in a discovery request when resource
114112
// locators are used for LDS/CDS. Any non-string field will have its JSON
115113
// encoding set as the context parameter value, with the exception of
116114
// metadata, which will be flattened (see example below). The supported field
@@ -168,12 +166,23 @@ message Bootstrap {
168166
// Optional duration between flushes to configured stats sinks. For
169167
// performance reasons Envoy latches counters and only flushes counters and
170168
// gauges at a periodic interval. If not specified the default is 5000ms (5
171-
// seconds).
169+
// seconds). Only one of `stats_flush_interval` or `stats_flush_on_admin`
170+
// can be set.
172171
// Duration must be at least 1ms and at most 5 min.
173-
google.protobuf.Duration stats_flush_interval = 7 [(validate.rules).duration = {
174-
lt {seconds: 300}
175-
gte {nanos: 1000000}
176-
}];
172+
google.protobuf.Duration stats_flush_interval = 7 [
173+
(validate.rules).duration = {
174+
lt {seconds: 300}
175+
gte {nanos: 1000000}
176+
},
177+
(udpa.annotations.field_migrate).oneof_promotion = "stats_flush"
178+
];
179+
180+
oneof stats_flush {
181+
// Flush stats to sinks only when queried for on the admin interface. If set,
182+
// a flush timer is not created. Only one of `stats_flush_on_admin` or
183+
// `stats_flush_interval` can be set.
184+
bool stats_flush_on_admin = 29 [(validate.rules).bool = {const: true}];
185+
}
177186

178187
// Optional watchdog configuration.
179188
// This is for a single watchdog configuration for the entire system.
@@ -243,10 +252,14 @@ message Bootstrap {
243252
// Each item contains extension specific configuration.
244253
repeated core.v3.TypedExtensionConfig bootstrap_extensions = 21;
245254

255+
// Specifies optional extensions instantiated at startup time and
256+
// invoked during crash time on the request that caused the crash.
257+
repeated FatalAction fatal_actions = 28;
258+
246259
// Configuration sources that will participate in
247-
// *udpa.core.v1.ResourceLocator* authority resolution. The algorithm is as
260+
// xdstp:// URL authority resolution. The algorithm is as
248261
// follows:
249-
// 1. The authority field is taken from the *udpa.core.v1.ResourceLocator*, call
262+
// 1. The authority field is taken from the xdstp:// URL, call
250263
// this *resource_authority*.
251264
// 2. *resource_authority* is compared against the authorities in any peer
252265
// *ConfigSource*. The peer *ConfigSource* is the configuration source
@@ -262,7 +275,7 @@ message Bootstrap {
262275
// [#not-implemented-hide:]
263276
repeated core.v3.ConfigSource config_sources = 22;
264277

265-
// Default configuration source for *udpa.core.v1.ResourceLocator* if all
278+
// Default configuration source for xdstp:// URLs if all
266279
// other resolution fails.
267280
// [#not-implemented-hide:]
268281
core.v3.ConfigSource default_config_source = 23;
@@ -420,6 +433,20 @@ message Watchdog {
420433
type.v3.Percent multikill_threshold = 5;
421434
}
422435

436+
// Fatal actions to run while crashing. Actions can be safe (meaning they are
437+
// async-signal safe) or unsafe. We run all safe actions before we run unsafe actions.
438+
// If using an unsafe action that could get stuck or deadlock, it important to
439+
// have an out of band system to terminate the process.
440+
//
441+
// The interface for the extension is ``Envoy::Server::Configuration::FatalAction``.
442+
// *FatalAction* extensions live in the ``envoy.extensions.fatal_actions`` API
443+
// namespace.
444+
message FatalAction {
445+
// Extension specific configuration for the action. It's expected to conform
446+
// to the ``Envoy::Server::Configuration::FatalAction`` interface.
447+
core.v3.TypedExtensionConfig config = 1;
448+
}
449+
423450
// Runtime :ref:`configuration overview <config_runtime>` (deprecated).
424451
message Runtime {
425452
option (udpa.annotations.versioning).previous_message_type = "envoy.config.bootstrap.v2.Runtime";
@@ -493,12 +520,7 @@ message RuntimeLayer {
493520
"envoy.config.bootstrap.v2.RuntimeLayer.RtdsLayer";
494521

495522
// Resource to subscribe to at *rtds_config* for the RTDS layer.
496-
string name = 1 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"];
497-
498-
// Resource locator for RTDS layer. This is mutually exclusive to *name*.
499-
// [#not-implemented-hide:]
500-
udpa.core.v1.ResourceLocator rtds_resource_locator = 3
501-
[(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"];
523+
string name = 1;
502524

503525
// RTDS configuration source.
504526
core.v3.ConfigSource rtds_config = 2;

api/src/main/proto/envoy/config/bootstrap/v4alpha/bootstrap.proto

Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import "google/protobuf/duration.proto";
1919
import "google/protobuf/struct.proto";
2020
import "google/protobuf/wrappers.proto";
2121

22-
import "udpa/core/v1/resource_locator.proto";
23-
2422
import "envoy/annotations/deprecation.proto";
2523
import "udpa/annotations/security.proto";
2624
import "udpa/annotations/status.proto";
@@ -38,7 +36,7 @@ option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSIO
3836
// <config_overview_bootstrap>` for more detail.
3937

4038
// Bootstrap :ref:`configuration overview <config_overview_bootstrap>`.
41-
// [#next-free-field: 28]
39+
// [#next-free-field: 30]
4240
message Bootstrap {
4341
option (udpa.annotations.versioning).previous_message_type =
4442
"envoy.config.bootstrap.v3.Bootstrap";
@@ -75,18 +73,18 @@ message Bootstrap {
7573
// :ref:`LDS <arch_overview_dynamic_config_lds>` configuration source.
7674
core.v4alpha.ConfigSource lds_config = 1;
7775

78-
// Resource locator for listener collection.
76+
// xdstp:// resource locator for listener collection.
7977
// [#not-implemented-hide:]
80-
udpa.core.v1.ResourceLocator lds_resources_locator = 5;
78+
string lds_resources_locator = 5;
8179

8280
// All post-bootstrap :ref:`Cluster <envoy_api_msg_config.cluster.v4alpha.Cluster>` definitions are
8381
// provided by a single :ref:`CDS <arch_overview_dynamic_config_cds>`
8482
// configuration source.
8583
core.v4alpha.ConfigSource cds_config = 2;
8684

87-
// Resource locator for cluster collection.
85+
// xdstp:// resource locator for cluster collection.
8886
// [#not-implemented-hide:]
89-
udpa.core.v1.ResourceLocator cds_resources_locator = 6;
87+
string cds_resources_locator = 6;
9088

9189
// A single :ref:`ADS <config_overview_ads>` source may be optionally
9290
// specified. This must have :ref:`api_type
@@ -108,7 +106,7 @@ message Bootstrap {
108106

109107
// A list of :ref:`Node <envoy_v3_api_msg_config.core.v3.Node>` field names
110108
// that will be included in the context parameters of the effective
111-
// *UdpaResourceLocator* that is sent in a discovery request when resource
109+
// xdstp:// URL that is sent in a discovery request when resource
112110
// locators are used for LDS/CDS. Any non-string field will have its JSON
113111
// encoding set as the context parameter value, with the exception of
114112
// metadata, which will be flattened (see example below). The supported field
@@ -163,15 +161,23 @@ message Bootstrap {
163161
// Configuration for internal processing of stats.
164162
metrics.v4alpha.StatsConfig stats_config = 13;
165163

166-
// Optional duration between flushes to configured stats sinks. For
167-
// performance reasons Envoy latches counters and only flushes counters and
168-
// gauges at a periodic interval. If not specified the default is 5000ms (5
169-
// seconds).
170-
// Duration must be at least 1ms and at most 5 min.
171-
google.protobuf.Duration stats_flush_interval = 7 [(validate.rules).duration = {
172-
lt {seconds: 300}
173-
gte {nanos: 1000000}
174-
}];
164+
oneof stats_flush {
165+
// Optional duration between flushes to configured stats sinks. For
166+
// performance reasons Envoy latches counters and only flushes counters and
167+
// gauges at a periodic interval. If not specified the default is 5000ms (5
168+
// seconds). Only one of `stats_flush_interval` or `stats_flush_on_admin`
169+
// can be set.
170+
// Duration must be at least 1ms and at most 5 min.
171+
google.protobuf.Duration stats_flush_interval = 7 [(validate.rules).duration = {
172+
lt {seconds: 300}
173+
gte {nanos: 1000000}
174+
}];
175+
176+
// Flush stats to sinks only when queried for on the admin interface. If set,
177+
// a flush timer is not created. Only one of `stats_flush_on_admin` or
178+
// `stats_flush_interval` can be set.
179+
bool stats_flush_on_admin = 29 [(validate.rules).bool = {const: true}];
180+
}
175181

176182
// Optional watchdogs configuration.
177183
// This is used for specifying different watchdogs for the different subsystems.
@@ -229,10 +235,14 @@ message Bootstrap {
229235
// Each item contains extension specific configuration.
230236
repeated core.v4alpha.TypedExtensionConfig bootstrap_extensions = 21;
231237

238+
// Specifies optional extensions instantiated at startup time and
239+
// invoked during crash time on the request that caused the crash.
240+
repeated FatalAction fatal_actions = 28;
241+
232242
// Configuration sources that will participate in
233-
// *udpa.core.v1.ResourceLocator* authority resolution. The algorithm is as
243+
// xdstp:// URL authority resolution. The algorithm is as
234244
// follows:
235-
// 1. The authority field is taken from the *udpa.core.v1.ResourceLocator*, call
245+
// 1. The authority field is taken from the xdstp:// URL, call
236246
// this *resource_authority*.
237247
// 2. *resource_authority* is compared against the authorities in any peer
238248
// *ConfigSource*. The peer *ConfigSource* is the configuration source
@@ -248,7 +258,7 @@ message Bootstrap {
248258
// [#not-implemented-hide:]
249259
repeated core.v4alpha.ConfigSource config_sources = 22;
250260

251-
// Default configuration source for *udpa.core.v1.ResourceLocator* if all
261+
// Default configuration source for xdstp:// URLs if all
252262
// other resolution fails.
253263
// [#not-implemented-hide:]
254264
core.v4alpha.ConfigSource default_config_source = 23;
@@ -412,6 +422,23 @@ message Watchdog {
412422
type.v3.Percent multikill_threshold = 5;
413423
}
414424

425+
// Fatal actions to run while crashing. Actions can be safe (meaning they are
426+
// async-signal safe) or unsafe. We run all safe actions before we run unsafe actions.
427+
// If using an unsafe action that could get stuck or deadlock, it important to
428+
// have an out of band system to terminate the process.
429+
//
430+
// The interface for the extension is ``Envoy::Server::Configuration::FatalAction``.
431+
// *FatalAction* extensions live in the ``envoy.extensions.fatal_actions`` API
432+
// namespace.
433+
message FatalAction {
434+
option (udpa.annotations.versioning).previous_message_type =
435+
"envoy.config.bootstrap.v3.FatalAction";
436+
437+
// Extension specific configuration for the action. It's expected to conform
438+
// to the ``Envoy::Server::Configuration::FatalAction`` interface.
439+
core.v4alpha.TypedExtensionConfig config = 1;
440+
}
441+
415442
// Runtime :ref:`configuration overview <config_runtime>` (deprecated).
416443
message Runtime {
417444
option (udpa.annotations.versioning).previous_message_type = "envoy.config.bootstrap.v3.Runtime";
@@ -484,14 +511,8 @@ message RuntimeLayer {
484511
option (udpa.annotations.versioning).previous_message_type =
485512
"envoy.config.bootstrap.v3.RuntimeLayer.RtdsLayer";
486513

487-
oneof name_specifier {
488-
// Resource to subscribe to at *rtds_config* for the RTDS layer.
489-
string name = 1;
490-
491-
// Resource locator for RTDS layer. This is mutually exclusive to *name*.
492-
// [#not-implemented-hide:]
493-
udpa.core.v1.ResourceLocator rtds_resource_locator = 3;
494-
}
514+
// Resource to subscribe to at *rtds_config* for the RTDS layer.
515+
string name = 1;
495516

496517
// RTDS configuration source.
497518
core.v4alpha.ConfigSource rtds_config = 2;

0 commit comments

Comments
 (0)