Skip to content

Commit

Permalink
xdstp: flatten resource locators/names to strings.
Browse files Browse the repository at this point in the history
As per discussion summarized in
envoyproxy#13555 (comment), we will not use structured
xdstp:// names/locators in the API initially. Instead, we will re-use existing string fields for
names and special case any name with a xdstp: prefix. We leave open the option of introducing
structured representation, in particular for efficiency wins, at a later point.

Risk level: Low (not in use yet)
Testing: CI

Signed-off-by: Harvey Tuch <htuch@google.com>
  • Loading branch information
htuch committed Dec 2, 2020
1 parent be92881 commit 35c1e91
Show file tree
Hide file tree
Showing 53 changed files with 119 additions and 371 deletions.
1 change: 0 additions & 1 deletion api/envoy/config/bootstrap/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ api_proto_package(
"//envoy/extensions/transport_sockets/tls/v3:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
"@com_github_cncf_udpa//xds/core/v3:pkg",
],
)
25 changes: 9 additions & 16 deletions api/envoy/config/bootstrap/v3/bootstrap.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";

import "xds/core/v3/resource_locator.proto";

import "envoy/annotations/deprecation.proto";
import "udpa/annotations/migrate.proto";
import "udpa/annotations/security.proto";
Expand Down Expand Up @@ -77,18 +75,18 @@ message Bootstrap {
// :ref:`LDS <arch_overview_dynamic_config_lds>` configuration source.
core.v3.ConfigSource lds_config = 1;

// Resource locator for listener collection.
// xdstp:// resource locator for listener collection.
// [#not-implemented-hide:]
xds.core.v3.ResourceLocator lds_resources_locator = 5;
string lds_resources_locator = 5;

// All post-bootstrap :ref:`Cluster <envoy_api_msg_config.cluster.v3.Cluster>` definitions are
// provided by a single :ref:`CDS <arch_overview_dynamic_config_cds>`
// configuration source.
core.v3.ConfigSource cds_config = 2;

// Resource locator for cluster collection.
// xdstp:// resource locator for cluster collection.
// [#not-implemented-hide:]
xds.core.v3.ResourceLocator cds_resources_locator = 6;
string cds_resources_locator = 6;

// A single :ref:`ADS <config_overview_ads>` source may be optionally
// specified. This must have :ref:`api_type
Expand All @@ -110,7 +108,7 @@ message Bootstrap {

// A list of :ref:`Node <envoy_v3_api_msg_config.core.v3.Node>` field names
// that will be included in the context parameters of the effective
// *XdsResourceLocator* that is sent in a discovery request when resource
// xdstp:// URL that is sent in a discovery request when resource
// locators are used for LDS/CDS. Any non-string field will have its JSON
// encoding set as the context parameter value, with the exception of
// metadata, which will be flattened (see example below). The supported field
Expand Down Expand Up @@ -248,9 +246,9 @@ message Bootstrap {
repeated FatalAction fatal_actions = 28;

// Configuration sources that will participate in
// *xds.core.v3.ResourceLocator* authority resolution. The algorithm is as
// xdstp:// URL authority resolution. The algorithm is as
// follows:
// 1. The authority field is taken from the *xds.core.v3.ResourceLocator*, call
// 1. The authority field is taken from the xdstp:// URL, call
// this *resource_authority*.
// 2. *resource_authority* is compared against the authorities in any peer
// *ConfigSource*. The peer *ConfigSource* is the configuration source
Expand All @@ -266,7 +264,7 @@ message Bootstrap {
// [#not-implemented-hide:]
repeated core.v3.ConfigSource config_sources = 22;

// Default configuration source for *xds.core.v3.ResourceLocator* if all
// Default configuration source for xdstp:// URLs if all
// other resolution fails.
// [#not-implemented-hide:]
core.v3.ConfigSource default_config_source = 23;
Expand Down Expand Up @@ -511,12 +509,7 @@ message RuntimeLayer {
"envoy.config.bootstrap.v2.RuntimeLayer.RtdsLayer";

// Resource to subscribe to at *rtds_config* for the RTDS layer.
string name = 1 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"];

// Resource locator for RTDS layer. This is mutually exclusive to *name*.
// [#not-implemented-hide:]
xds.core.v3.ResourceLocator rtds_resource_locator = 3
[(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"];
string name = 1;

// RTDS configuration source.
core.v3.ConfigSource rtds_config = 2;
Expand Down
1 change: 0 additions & 1 deletion api/envoy/config/bootstrap/v4alpha/BUILD

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 10 additions & 18 deletions api/envoy/config/bootstrap/v4alpha/bootstrap.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions api/envoy/config/cluster/v3/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";

import "xds/core/v3/collection_entry.proto";
import "xds/core/v3/resource_locator.proto";

import "envoy/annotations/deprecation.proto";
import "udpa/annotations/migrate.proto";
Expand Down Expand Up @@ -187,13 +186,8 @@ message Cluster {

// Optional alternative to cluster name to present to EDS. This does not
// have the same restrictions as cluster name, i.e. it may be arbitrary
// length.
string service_name = 2 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"];

// Resource locator for EDS. This is mutually exclusive to *service_name*.
// [#not-implemented-hide:]
xds.core.v3.ResourceLocator eds_resource_locator = 3
[(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"];
// length. This may be a xdstp:// URL.
string service_name = 2;
}

// Optionally divide the endpoints in this cluster into subsets defined by
Expand Down
15 changes: 4 additions & 11 deletions api/envoy/config/cluster/v4alpha/cluster.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions api/envoy/config/core/v3/config_source.proto
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,9 @@ message RateLimitSettings {
message ConfigSource {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.ConfigSource";

// Authorities that this config source may be used for. An authority specified
// in a *xds.core.v3.ResourceLocator* is resolved to a *ConfigSource* prior
// to configuration fetch. This field provides the association between
// authority name and configuration source.
// Authorities that this config source may be used for. An authority specified in a xdstp:// URL
// is resolved to a *ConfigSource* prior to configuration fetch. This field provides the
// association between authority name and configuration source.
// [#not-implemented-hide:]
repeated xds.core.v3.Authority authorities = 7;

Expand Down
7 changes: 3 additions & 4 deletions api/envoy/config/core/v4alpha/config_source.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion api/envoy/extensions/common/tap/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ api_proto_package(
"//envoy/config/common/tap/v2alpha:pkg",
"//envoy/config/tap/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
"@com_github_cncf_udpa//xds/core/v3:pkg",
],
)
2 changes: 0 additions & 2 deletions api/envoy/extensions/common/tap/v3/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ package envoy.extensions.common.tap.v3;

import "envoy/config/tap/v3/common.proto";

import "xds/core/v3/resource_locator.proto";

import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
Expand Down
1 change: 0 additions & 1 deletion api/envoy/extensions/common/tap/v4alpha/BUILD

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions api/envoy/extensions/common/tap/v4alpha/common.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ api_proto_package(
"//envoy/type/tracing/v3:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
"@com_github_cncf_udpa//xds/core/v3:pkg",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";

import "xds/core/v3/resource_locator.proto";

import "envoy/annotations/deprecation.proto";
import "udpa/annotations/migrate.proto";
import "udpa/annotations/security.proto";
Expand Down Expand Up @@ -651,13 +649,7 @@ message Rds {
// API. This allows an Envoy configuration with multiple HTTP listeners (and
// associated HTTP connection manager filters) to use different route
// configurations.
string route_config_name = 2
[(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"];

// Resource locator for RDS. This is mutually exclusive to *route_config_name*.
// [#not-implemented-hide:]
xds.core.v3.ResourceLocator rds_resource_locator = 3
[(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"];
string route_config_name = 2;
}

// This message is used to work around the limitations with 'oneof' and repeated fields.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion api/envoy/extensions/transport_sockets/tls/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ api_proto_package(
"//envoy/config/core/v3:pkg",
"//envoy/type/matcher/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
"@com_github_cncf_udpa//xds/core/v3:pkg",
],
)
18 changes: 4 additions & 14 deletions api/envoy/extensions/transport_sockets/tls/v3/secret.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/config_source.proto";
import "envoy/extensions/transport_sockets/tls/v3/common.proto";

import "xds/core/v3/resource_locator.proto";

import "udpa/annotations/migrate.proto";
import "udpa/annotations/sensitive.proto";
import "udpa/annotations/status.proto";
Expand All @@ -31,18 +29,10 @@ message GenericSecret {
message SdsSecretConfig {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.auth.SdsSecretConfig";

// Name (FQDN, UUID, SPKI, SHA256, etc.) by which the secret can be uniquely referred to.
// When both name and config are specified, then secret can be fetched and/or reloaded via
// SDS. When only name is specified, then secret will be loaded from static resources.
string name = 1 [
(validate.rules).string = {min_len: 1},
(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"
];

// Resource locator for SDS. This is mutually exclusive to *name*.
// [#not-implemented-hide:]
xds.core.v3.ResourceLocator sds_resource_locator = 3
[(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"];
// Name by which the secret can be uniquely referred to. When both name and config are specified,
// then secret can be fetched and/or reloaded via SDS. When only name is specified, then secret
// will be loaded from static resources.
string name = 1 [(validate.rules).string = {min_len: 1}];

config.core.v3.ConfigSource sds_config = 2;
}
Expand Down
1 change: 0 additions & 1 deletion api/envoy/extensions/transport_sockets/tls/v4alpha/BUILD

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 35c1e91

Please sign in to comment.