From 11cde5d7bec6c6a1f751f448d880bb409ee8a8c2 Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Mon, 6 May 2019 21:28:37 +0000 Subject: [PATCH] runtime: support bootstrap runtime configuration. (#6759) As a first step towards TDS, add support for proto/JSON representations of the runtime virtual file system and plumb this into bootstrap. "numerator" and "denominator" are now reserved keywords and can't be used in runtime keys; this simplifies parsing significantly. It is not expected that these are widely used, due to the difficulty of ensuring atomicity if representing fractions, but this is technically a runtime API breaking change. Risk level: Medium (due to the reserved word changes). Testing: Unit and server tests added. Part of #6708 Signed-off-by: Harvey Tuch Mirrored from https://github.com/envoyproxy/envoy @ eb699ab2d53aadf2c5a26ed02fcc1e7de1df7d8a --- envoy/config/bootstrap/v2/bootstrap.proto | 11 +++++++++-- test/validate/pgv_test.cc | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/envoy/config/bootstrap/v2/bootstrap.proto b/envoy/config/bootstrap/v2/bootstrap.proto index 46e52622..19e6faeb 100644 --- a/envoy/config/bootstrap/v2/bootstrap.proto +++ b/envoy/config/bootstrap/v2/bootstrap.proto @@ -23,6 +23,7 @@ import "envoy/config/metrics/v2/stats.proto"; import "envoy/config/overload/v2alpha/overload.proto"; import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; import "validate/validate.proto"; import "gogoproto/gogo.proto"; @@ -205,8 +206,8 @@ message Runtime { // symbolic link. An atomic link swap is used when a new tree should be // switched to. This parameter specifies the path to the symbolic link. Envoy // will watch the location for changes and reload the file system tree when - // they happen. - string symlink_root = 1 [(validate.rules).string.min_bytes = 1]; + // they happen. If this parameter is not set, there will be no disk based runtime. + string symlink_root = 1; // Specifies the subdirectory to load within the root directory. This is // useful if multiple systems share the same delivery mechanism. Envoy @@ -220,4 +221,10 @@ message Runtime { // Sometimes it is useful to have a per service cluster directory for runtime // configuration. See below for exactly how the override directory is used. string override_subdirectory = 3; + + // Static base runtime. This will be :ref:`overridden + // ` by other runtime layers, e.g. + // disk or admin. This follows the :ref:`runtime protobuf JSON representation + // encoding `. + google.protobuf.Struct base = 4; } diff --git a/test/validate/pgv_test.cc b/test/validate/pgv_test.cc index 464ad3d7..afb75083 100644 --- a/test/validate/pgv_test.cc +++ b/test/validate/pgv_test.cc @@ -54,7 +54,7 @@ template struct TestCase { // from data plane API. int main(int argc, char* argv[]) { envoy::config::bootstrap::v2::Bootstrap invalid_bootstrap; - invalid_bootstrap.mutable_runtime(); + invalid_bootstrap.mutable_static_resources()->add_clusters(); // This is a baseline test of the validation features we care about. It's // probably not worth adding in every filter and field that we want to valid // in the API upfront, but as regressions occur, this is the place to add the