grpc: add support for custom channel args. (#11277)

This is useful to allow plumbing of args such as grpc.keepalive_time_ms,
e.g. as a fix for #5173.

Risk level: Low
Testing: Unit and integration tests added.

Signed-off-by: Harvey Tuch <htuch@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ 2e5a36522f48c7f3ffe2b5b3f163a89194839e63
master-ci-test
data-plane-api(CircleCI) 5 years ago
parent 94acd2707d
commit 98dcc622d3
  1. 21
      envoy/config/core/v3/grpc_service.proto
  2. 27
      envoy/config/core/v4alpha/grpc_service.proto

@ -38,7 +38,7 @@ message GrpcService {
string cluster_name = 1 [(validate.rules).string = {min_bytes: 1}];
}
// [#next-free-field: 8]
// [#next-free-field: 9]
message GoogleGrpc {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.core.GrpcService.GoogleGrpc";
@ -203,6 +203,22 @@ message GrpcService {
}
}
// Channel arguments.
message ChannelArgs {
message Value {
// Pointer values are not supported, since they don't make any sense when
// delivered via the API.
oneof value_specifier {
string string_value = 1;
int64 int_value = 2;
}
}
// See grpc_types.h GRPC_ARG #defines for keys that work here.
map<string, Value> args = 1;
}
// The target URI when using the `Google C++ gRPC client
// <https://github.com/grpc/grpc>`_. SSL credentials will be supplied in
// :ref:`channel_credentials <envoy_api_field_config.core.v3.GrpcService.GoogleGrpc.channel_credentials>`.
@ -237,6 +253,9 @@ message GrpcService {
// How many bytes each stream can buffer internally.
// If not set an implementation defined default is applied (1MiB).
google.protobuf.UInt32Value per_stream_buffer_limit_bytes = 7;
// Custom channels args.
ChannelArgs channel_args = 8;
}
reserved 4;

@ -38,7 +38,7 @@ message GrpcService {
string cluster_name = 1 [(validate.rules).string = {min_bytes: 1}];
}
// [#next-free-field: 8]
// [#next-free-field: 9]
message GoogleGrpc {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.core.v3.GrpcService.GoogleGrpc";
@ -203,6 +203,28 @@ message GrpcService {
}
}
// Channel arguments.
message ChannelArgs {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs";
message Value {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs.Value";
// Pointer values are not supported, since they don't make any sense when
// delivered via the API.
oneof value_specifier {
string string_value = 1;
int64 int_value = 2;
}
}
// See grpc_types.h GRPC_ARG #defines for keys that work here.
map<string, Value> args = 1;
}
// The target URI when using the `Google C++ gRPC client
// <https://github.com/grpc/grpc>`_. SSL credentials will be supplied in
// :ref:`channel_credentials <envoy_api_field_config.core.v4alpha.GrpcService.GoogleGrpc.channel_credentials>`.
@ -237,6 +259,9 @@ message GrpcService {
// How many bytes each stream can buffer internally.
// If not set an implementation defined default is applied (1MiB).
google.protobuf.UInt32Value per_stream_buffer_limit_bytes = 7;
// Custom channels args.
ChannelArgs channel_args = 8;
}
reserved 4;

Loading…
Cancel
Save