From 3bd32ef21b7c7a42b928e54b14168e64e0b2c097 Mon Sep 17 00:00:00 2001 From: "data-plane-api(Azure Pipelines)" Date: Thu, 14 Oct 2021 13:17:53 +0000 Subject: [PATCH] [config] support an inline RouteConfiguration in ScopedRouteConfiguration (#18377) Support an inline RouteConfiguration in ScopedRouteConfiguration. This change enables fully inlined scoped route configuration by allowing users to specify an inline `RouteConfiguration` in the scope's config, as opposed to requiring a `route_configuration_name` to use for an RDS subscription. Signed-off-by: Andres Guedez Mirrored from https://github.com/envoyproxy/envoy @ cbc05d480cc24fc96bbbbd476cc31b25402d6777 --- envoy/config/route/v3/scoped_route.proto | 16 ++++++++++++++-- .../v3/http_connection_manager.proto | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/envoy/config/route/v3/scoped_route.proto b/envoy/config/route/v3/scoped_route.proto index eb47d7e1..1b0904ec 100644 --- a/envoy/config/route/v3/scoped_route.proto +++ b/envoy/config/route/v3/scoped_route.proto @@ -2,6 +2,9 @@ syntax = "proto3"; package envoy.config.route.v3; +import "envoy/config/route/v3/route.proto"; + +import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; import "udpa/annotations/versioning.proto"; import "validate/validate.proto"; @@ -16,7 +19,10 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // Specifies a routing scope, which associates a // :ref:`Key` to a -// :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration` (identified by its resource name). +// :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. +// The :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration` can be obtained dynamically +// via RDS (:ref:`route_configuration_name`) +// or specified inline (:ref:`route_configuration`). // // The HTTP connection manager builds up a table consisting of these Key to // RouteConfiguration mappings, and looks up the RouteConfiguration to use per @@ -73,6 +79,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // would result in the routing table defined by the `route-config1` // RouteConfiguration being assigned to the HTTP request/stream. // +// [#next-free-field: 6] message ScopedRouteConfiguration { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.ScopedRouteConfiguration"; @@ -113,7 +120,12 @@ message ScopedRouteConfiguration { // The resource name to use for a :ref:`envoy_v3_api_msg_service.discovery.v3.DiscoveryRequest` to an // RDS server to fetch the :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration` associated // with this scope. - string route_configuration_name = 2 [(validate.rules).string = {min_len: 1}]; + string route_configuration_name = 2 + [(udpa.annotations.field_migrate).oneof_promotion = "route_config"]; + + // The :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration` associated with the scope. + RouteConfiguration route_configuration = 5 + [(udpa.annotations.field_migrate).oneof_promotion = "route_config"]; // The key to match against. Key key = 3 [(validate.rules).message = {required: true}]; diff --git a/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto b/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto index 3fb4bfa0..93d25590 100644 --- a/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto +++ b/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto @@ -911,7 +911,7 @@ message ScopedRoutes { // Configuration source specifier for RDS. // This config source is used to subscribe to RouteConfiguration resources specified in // ScopedRouteConfiguration messages. - config.core.v3.ConfigSource rds_config_source = 3 [(validate.rules).message = {required: true}]; + config.core.v3.ConfigSource rds_config_source = 3; oneof config_specifier { option (validate.required) = true;