Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lds: Add HTTP API listener. #8170

Merged
merged 12 commits into from
Sep 23, 2019
2 changes: 2 additions & 0 deletions api/envoy/api/v2/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ api_proto_package(
"//envoy/api/v2/listener:pkg",
"//envoy/api/v2/ratelimit:pkg",
"//envoy/api/v2/route:pkg",
"//envoy/config/api_listener/v2:pkg",
"//envoy/type",
],
)
Expand Down Expand Up @@ -86,6 +87,7 @@ api_proto_library_internal(
"//envoy/api/v2/core:base",
"//envoy/api/v2/listener",
"//envoy/api/v2/listener:udp_listener_config",
"//envoy/config/api_listener/v2:api_listener",
],
)

Expand Down
16 changes: 15 additions & 1 deletion api/envoy/api/v2/lds.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import "envoy/api/v2/core/base.proto";
import "envoy/api/v2/discovery.proto";
import "envoy/api/v2/listener/listener.proto";
import "envoy/api/v2/listener/udp_listener_config.proto";
import "envoy/config/api_listener/v2/api_listener.proto";

import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
Expand Down Expand Up @@ -45,7 +46,7 @@ service ListenerDiscoveryService {
}
}

// [#comment:next free field: 19]
// [#comment:next free field: 20]
message Listener {
// The unique name by which this listener is known. If no name is provided,
// Envoy will allocate an internal UUID for the listener. If the listener is to be dynamically
Expand Down Expand Up @@ -203,4 +204,17 @@ message Listener {
// <envoy_api_field_listener.UdpListenerConfig.udp_listener_name>` = "raw_udp_listener" for
// creating a packet-oriented UDP listener. If not present, treat it as "raw_udp_listener".
listener.UdpListenerConfig udp_listener_config = 18;

// [#not-implemented-hide:]
// Used to represent an API listener, which is used in non-proxy clients. The type of API
// exposed to the non-proxy application depends on the type of API listener.
// When this field is set, no other field except for :ref:`name<envoy_api_field_Listener.name>`
// should be set.
// [#next-major-version: In the v3 API, instead of this messy approach where the socket
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with this. It would be nice to subsume socket-based listener fields to their own message.

// listener fields are directly in the top-level Listener message and the API listener types
// are in the ApiListener message, the socket listener messages should be in their own message,
// and the top-level Listener should essentially be a oneof that selects between the
// socket listener and the various types of API listener. That way, a given Listener message
// can structurally only contain the fields of the relevant type.]
envoy.config.listener.v2.ApiListener api_listener = 19;
}
18 changes: 18 additions & 0 deletions api/envoy/config/api_listener/v2/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_library_internal", "api_proto_package")

licenses(["notice"]) # Apache 2

package_group(
name = "friends",
packages = [
"//envoy/api/v2",
],
)

api_proto_package()

api_proto_library_internal(
name = "api_listener",
srcs = ["api_listener.proto"],
visibility = [":friends"],
)
24 changes: 24 additions & 0 deletions api/envoy/config/api_listener/v2/api_listener.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
syntax = "proto3";

package envoy.config.listener.v2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: also change the directory to api/envoy/config/listener/v2. LGTM once that is done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


option java_outer_classname = "ApiListenerProto";
option java_multiple_files = true;
option java_package = "io.envoyproxy.envoy.config.api_listener.v2";

import "google/protobuf/any.proto";

// [#not-implemented-hide:]
// Describes a type of API listener, which is used in non-proxy clients. The type of API
// exposed to the non-proxy application depends on the type of API listener.
message ApiListener {
// The type in this field determines the type of API listener. At present, the following
// types are supported:
// envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager (HTTP)
// [#next-major-version: In the v3 API, replace this Any field with a oneof containing the
// specific config message for each type of API listener. We could not do this in v2 because
// it would have caused circular dependencies for go protos: lds.proto depends on this file,
// and http_connection_manager.proto depends on rds.proto, which is in the same directory as
// lds.proto, so lds.proto cannot depend on this file.]
google.protobuf.Any api_listener = 1;
}