From 0b35f3efc31621953bc2eb7458d01d8eab984394 Mon Sep 17 00:00:00 2001 From: htuch Date: Mon, 24 Jul 2017 16:05:22 -0400 Subject: [PATCH] cds/protocol: split out shared frontend/backend protocol options. (#120) Avoid false dependency on CDS by HTTP connection manager. This also manifests at the code level when implementing v1 -> v2 translation. --- api/BUILD | 6 ++++++ api/cds.proto | 20 +------------------- api/filter/http_connection_manager.proto | 2 +- api/protocol.proto | 23 +++++++++++++++++++++++ 4 files changed, 31 insertions(+), 20 deletions(-) create mode 100644 api/protocol.proto diff --git a/api/BUILD b/api/BUILD index 023b3e86..25f54967 100644 --- a/api/BUILD +++ b/api/BUILD @@ -48,6 +48,7 @@ api_proto_library( ":base", ":health_check", ":tls_context", + ":protocol", ], ) @@ -83,6 +84,11 @@ api_proto_library( ], ) +api_proto_library( + name = "protocol", + srcs = ["protocol.proto"], +) + api_proto_library( name = "rlds", srcs = ["rlds.proto"], diff --git a/api/cds.proto b/api/cds.proto index 6f11bd7f..5e8a4de8 100644 --- a/api/cds.proto +++ b/api/cds.proto @@ -5,6 +5,7 @@ package envoy.api.v2; import "api/address.proto"; import "api/base.proto"; import "api/health_check.proto"; +import "api/protocol.proto"; import "api/tls_context.proto"; import "google/api/annotations.proto"; @@ -51,25 +52,6 @@ message CircuitBreakers { repeated Thresholds thresholds = 1; } - -message TcpProtocolOptions { -} - -message Http1ProtocolOptions { -} - -message Http2ProtocolOptions { - google.protobuf.UInt32Value per_stream_buffer_limit_bytes = 1; - google.protobuf.UInt32Value hpack_table_size = 2; - google.protobuf.UInt32Value max_concurrent_streams = 3; - google.protobuf.UInt32Value initial_stream_window_size = 4; - google.protobuf.UInt32Value initial_connection_window_size = 5; -} - -message GrpcProtocolOptions { - Http2ProtocolOptions http2_protocol_options = 1; -} - message Cluster { // Supplies the name of the cluster which must be unique across all clusters. // The cluster name is used when emitting statistics. The cluster name can be diff --git a/api/filter/http_connection_manager.proto b/api/filter/http_connection_manager.proto index 9a7a6b6e..c777e515 100644 --- a/api/filter/http_connection_manager.proto +++ b/api/filter/http_connection_manager.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package envoy.api.v2.filter; import "api/base.proto"; -import "api/cds.proto"; +import "api/protocol.proto"; import "api/rds.proto"; import "google/protobuf/duration.proto"; diff --git a/api/protocol.proto b/api/protocol.proto new file mode 100644 index 00000000..8abb4831 --- /dev/null +++ b/api/protocol.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; + +package envoy.api.v2; + +import "google/protobuf/wrappers.proto"; + +message TcpProtocolOptions { +} + +message Http1ProtocolOptions { +} + +message Http2ProtocolOptions { + google.protobuf.UInt32Value per_stream_buffer_limit_bytes = 1; + google.protobuf.UInt32Value hpack_table_size = 2; + google.protobuf.UInt32Value max_concurrent_streams = 3; + google.protobuf.UInt32Value initial_stream_window_size = 4; + google.protobuf.UInt32Value initial_connection_window_size = 5; +} + +message GrpcProtocolOptions { + Http2ProtocolOptions http2_protocol_options = 1; +}