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 <htuch@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ eb699ab2d53aadf2c5a26ed02fcc1e7de1df7d8a
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent b28998889d
commit 11cde5d7be
  1. 11
      envoy/config/bootstrap/v2/bootstrap.proto
  2. 2
      test/validate/pgv_test.cc

@ -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
// <config_runtime_layering>` by other runtime layers, e.g.
// disk or admin. This follows the :ref:`runtime protobuf JSON representation
// encoding <config_runtime_proto_json>`.
google.protobuf.Struct base = 4;
}

@ -54,7 +54,7 @@ template <class Proto> 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

Loading…
Cancel
Save