Skip to content

Commit

Permalink
lds: Add HTTP API listener. (envoyproxy#8170)
Browse files Browse the repository at this point in the history
Signed-off-by: Mark D. Roth <[email protected]>
  • Loading branch information
markdroth committed Sep 24, 2019
1 parent 8b1081f commit 46140ff
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 1 deletion.
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/listener/v2:pkg",
"//envoy/type",
],
)
Expand Down Expand Up @@ -87,6 +88,7 @@ api_proto_library_internal(
"//envoy/api/v2/core:base",
"//envoy/api/v2/listener",
"//envoy/api/v2/listener:udp_listener_config",
"//envoy/config/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/listener/v2/api_listener.proto";

import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
Expand Down Expand Up @@ -42,7 +43,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 @@ -200,4 +201,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
// 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/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/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;

option java_outer_classname = "ApiListenerProto";
option java_multiple_files = true;
option java_package = "io.envoyproxy.envoy.config.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;
}

0 comments on commit 46140ff

Please sign in to comment.