From 8e32c3eab6eff9d5173cdba25ef91ca5a1527fa9 Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Tue, 18 Jun 2019 23:19:24 +0000 Subject: [PATCH] rtds: Runtime Discovery Service implementation. (#7251) Fixes #6708. Risk level: Low Testing: Unit and integration tests added. Signed-off-by: Harvey Tuch Mirrored from https://github.com/envoyproxy/envoy @ 07da3346bee84a7762052d9ce9f343a009ae994f --- docs/BUILD | 1 + envoy/config/bootstrap/v2/bootstrap.proto | 28 ++++++++----------- envoy/service/discovery/v2/BUILD | 8 +++--- .../discovery/v2/{tds.proto => rtds.proto} | 22 +++++++++++---- test/build/BUILD | 2 +- xds_protocol.rst | 1 + 6 files changed, 34 insertions(+), 28 deletions(-) rename envoy/service/discovery/v2/{tds.proto => rtds.proto} (59%) diff --git a/docs/BUILD b/docs/BUILD index d2dbcd26..1cd82c78 100644 --- a/docs/BUILD +++ b/docs/BUILD @@ -89,6 +89,7 @@ proto_library( "//envoy/service/auth/v2:attribute_context", "//envoy/service/auth/v2:external_auth", "//envoy/service/discovery/v2:ads", + "//envoy/service/discovery/v2:rtds", "//envoy/service/load_stats/v2:lrs", "//envoy/service/metrics/v2:metrics_service", "//envoy/service/ratelimit/v2:rls", diff --git a/envoy/config/bootstrap/v2/bootstrap.proto b/envoy/config/bootstrap/v2/bootstrap.proto index caa9dce5..d7d412da 100644 --- a/envoy/config/bootstrap/v2/bootstrap.proto +++ b/envoy/config/bootstrap/v2/bootstrap.proto @@ -237,13 +237,6 @@ message Runtime { } message RuntimeLayer { - // :ref:`Static runtime ` layer. - message StaticLayer { - // This follows the :ref:`runtime protobuf JSON representation encoding - // `. - google.protobuf.Struct value = 1; - } - // :ref:`Disk runtime ` layer. message DiskLayer { // The implementation assumes that the file system tree is accessed via a @@ -264,27 +257,28 @@ message RuntimeLayer { message AdminLayer { } - // [#not-implemented-hide:] - message TdsLayer { - // Resource to subscribe to at *tds_config* for the TDS layer. + // :ref:`Runtime Discovery Service (RTDS) ` layer. + message RtdsLayer { + // Resource to subscribe to at *rtds_config* for the RTDS layer. string name = 1; - // TDS configuration source. - envoy.api.v2.core.ConfigSource tds_config = 2; + // RTDS configuration source. + envoy.api.v2.core.ConfigSource rtds_config = 2; } // Descriptive name for the runtime layer. This is only used for the runtime // :http:get:`/runtime` output. - string name = 1; + string name = 1 [(validate.rules).string.min_bytes = 1]; oneof layer_specifier { - // Unlike static xDS resources, this static layer is overridable by later - // layers in the runtime virtual filesystem. + // :ref:`Static runtime ` layer. + // This follows the :ref:`runtime protobuf JSON representation encoding + // `. Unlike static xDS resources, this static + // layer is overridable by later layers in the runtime virtual filesystem. google.protobuf.Struct static_layer = 2; DiskLayer disk_layer = 3; AdminLayer admin_layer = 4; - // [#not-implemented-hide:] - TdsLayer tds_layer = 5; + RtdsLayer rtds_layer = 5; } } diff --git a/envoy/service/discovery/v2/BUILD b/envoy/service/discovery/v2/BUILD index fdd93975..a9c2efd0 100644 --- a/envoy/service/discovery/v2/BUILD +++ b/envoy/service/discovery/v2/BUILD @@ -58,8 +58,8 @@ api_go_grpc_library( ) api_proto_library_internal( - name = "tds", - srcs = ["tds.proto"], + name = "rtds", + srcs = ["rtds.proto"], has_services = 1, deps = [ "//envoy/api/v2:discovery", @@ -67,8 +67,8 @@ api_proto_library_internal( ) api_go_grpc_library( - name = "tds", - proto = ":tds", + name = "rtds", + proto = ":rtds", deps = [ "//envoy/api/v2:discovery_go_proto", ], diff --git a/envoy/service/discovery/v2/tds.proto b/envoy/service/discovery/v2/rtds.proto similarity index 59% rename from envoy/service/discovery/v2/tds.proto rename to envoy/service/discovery/v2/rtds.proto index eb317633..582a1436 100644 --- a/envoy/service/discovery/v2/tds.proto +++ b/envoy/service/discovery/v2/rtds.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.service.discovery.v2; -option java_outer_classname = "TdsProto"; +option java_outer_classname = "RtdsProto"; option java_multiple_files = true; option java_package = "io.envoyproxy.envoy.service.discovery.v2"; option java_generic_services = true; @@ -12,18 +12,26 @@ import "envoy/api/v2/discovery.proto"; import "google/api/annotations.proto"; import "google/protobuf/struct.proto"; +import "validate/validate.proto"; + +// [#protodoc-title: runTime Discovery Service (RTDS)] +// RTDS :ref:`configuration overview ` + // [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing // services: https://github.com/google/protobuf/issues/4221 -message TdsDummy { +message RtdsDummy { } // Discovery service for Runtime resources. -// [#not-implemented-hide:] service RuntimeDiscoveryService { rpc StreamRuntime(stream envoy.api.v2.DiscoveryRequest) returns (stream envoy.api.v2.DiscoveryResponse) { } + rpc DeltaRuntime(stream envoy.api.v2.DeltaDiscoveryRequest) + returns (stream envoy.api.v2.DeltaDiscoveryResponse) { + } + rpc FetchRuntime(envoy.api.v2.DiscoveryRequest) returns (envoy.api.v2.DiscoveryResponse) { option (google.api.http) = { post: "/v2/discovery:runtime" @@ -32,8 +40,10 @@ service RuntimeDiscoveryService { } } -// TDS resource type. This describes a layer in the runtime virtual filesystem. -// [#not-implemented-hide:] +// RTDS resource type. This describes a layer in the runtime virtual filesystem. message Runtime { - google.protobuf.Struct layer = 1; + // Runtime resource name. This makes the Runtime a self-describing xDS + // resource. + string name = 1 [(validate.rules).string.min_bytes = 1]; + google.protobuf.Struct layer = 2; } diff --git a/test/build/BUILD b/test/build/BUILD index 9eb52524..ab1e8640 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -13,7 +13,7 @@ api_cc_test( "//envoy/service/accesslog/v2:als", "//envoy/service/discovery/v2:ads", "//envoy/service/discovery/v2:hds", - "//envoy/service/discovery/v2:tds", + "//envoy/service/discovery/v2:rtds", "//envoy/service/metrics/v2:metrics_service", "//envoy/service/ratelimit/v2:rls", ], diff --git a/xds_protocol.rst b/xds_protocol.rst index 3906d64f..515c8634 100644 --- a/xds_protocol.rst +++ b/xds_protocol.rst @@ -60,6 +60,7 @@ correspondence between an xDS API and a resource type. That is: - CDS: :ref:`envoy.api.v2.Cluster ` - EDS: :ref:`envoy.api.v2.ClusterLoadAssignment ` - SDS: :ref:`envoy.api.v2.Auth.Secret ` +- RTDS: :ref:`envoy.service.discovery.v2.Runtime ` The concept of `type URLs `_ appears below, and takes the form `type.googleapis.com/`, e.g.