Skip to content

Commit

Permalink
xds: update envoy proto and udpa proto (v1.28.v backport) (#6769)
Browse files Browse the repository at this point in the history
Update envoy proto to c0ab3a4374144728c1e193fc2d43951ed36ccdb7 and udpa proto to edbea6a78f6d1ba34edc69c53a396b1d88d59651.
  • Loading branch information
voidzcy committed Feb 27, 2020
1 parent df1b678 commit 2ec86c1
Show file tree
Hide file tree
Showing 59 changed files with 4,477 additions and 3,226 deletions.
Expand Up @@ -17,8 +17,6 @@

/**
* <pre>
* [#protodoc-title: HTTP scoped routing configuration]
* * Routing :ref:`architecture overview &lt;arch_overview_http_routing&gt;`
* The Scoped Routes Discovery Service (SRDS) API distributes
* :ref:`ScopedRouteConfiguration&lt;envoy_api_msg.ScopedRouteConfiguration&gt;`
* resources. Each ScopedRouteConfiguration resource represents a "routing
Expand Down Expand Up @@ -177,8 +175,6 @@ public ScopedRoutesDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, i

/**
* <pre>
* [#protodoc-title: HTTP scoped routing configuration]
* * Routing :ref:`architecture overview &lt;arch_overview_http_routing&gt;`
* The Scoped Routes Discovery Service (SRDS) API distributes
* :ref:`ScopedRouteConfiguration&lt;envoy_api_msg.ScopedRouteConfiguration&gt;`
* resources. Each ScopedRouteConfiguration resource represents a "routing
Expand Down Expand Up @@ -240,8 +236,6 @@ public void fetchScopedRoutes(io.envoyproxy.envoy.api.v2.DiscoveryRequest reques

/**
* <pre>
* [#protodoc-title: HTTP scoped routing configuration]
* * Routing :ref:`architecture overview &lt;arch_overview_http_routing&gt;`
* The Scoped Routes Discovery Service (SRDS) API distributes
* :ref:`ScopedRouteConfiguration&lt;envoy_api_msg.ScopedRouteConfiguration&gt;`
* resources. Each ScopedRouteConfiguration resource represents a "routing
Expand Down Expand Up @@ -290,8 +284,6 @@ public void fetchScopedRoutes(io.envoyproxy.envoy.api.v2.DiscoveryRequest reques

/**
* <pre>
* [#protodoc-title: HTTP scoped routing configuration]
* * Routing :ref:`architecture overview &lt;arch_overview_http_routing&gt;`
* The Scoped Routes Discovery Service (SRDS) API distributes
* :ref:`ScopedRouteConfiguration&lt;envoy_api_msg.ScopedRouteConfiguration&gt;`
* resources. Each ScopedRouteConfiguration resource represents a "routing
Expand Down Expand Up @@ -323,8 +315,6 @@ public io.envoyproxy.envoy.api.v2.DiscoveryResponse fetchScopedRoutes(io.envoypr

/**
* <pre>
* [#protodoc-title: HTTP scoped routing configuration]
* * Routing :ref:`architecture overview &lt;arch_overview_http_routing&gt;`
* The Scoped Routes Discovery Service (SRDS) API distributes
* :ref:`ScopedRouteConfiguration&lt;envoy_api_msg.ScopedRouteConfiguration&gt;`
* resources. Each ScopedRouteConfiguration resource represents a "routing
Expand Down
Expand Up @@ -20,13 +20,13 @@
* Virtual Host Discovery Service (VHDS) is used to dynamically update the list of virtual hosts for
* a given RouteConfiguration. If VHDS is configured a virtual host list update will be triggered
* during the processing of an HTTP request if a route for the request cannot be resolved. The
* :ref:`resource_names_subscribe &lt;envoy_api_msg_DeltaDiscoveryRequest.resource_names_subscribe&gt;`
* :ref:`resource_names_subscribe &lt;envoy_api_field_DeltaDiscoveryRequest.resource_names_subscribe&gt;`
* field contains a list of virtual host names or aliases to track. The contents of an alias would
* be the contents of a *host* or *authority* header used to make an http request. An xDS server
* will match an alias to a virtual host based on the content of :ref:`domains'
* &lt;envoy_api_msg_route.VirtualHost.domains&gt;` field. The *resource_names_unsubscribe* field contains
* a list of virtual host names that have been :ref:`unsubscribed &lt;xds_protocol_unsubscribe&gt;`
* from the routing table associated with the RouteConfiguration.
* &lt;envoy_api_field_route.VirtualHost.domains&gt;` field. The *resource_names_unsubscribe* field
* contains a list of virtual host names that have been :ref:`unsubscribed
* &lt;xds_protocol_unsubscribe&gt;` from the routing table associated with the RouteConfiguration.
* </pre>
*/
@javax.annotation.Generated(
Expand Down Expand Up @@ -119,13 +119,13 @@ public VirtualHostDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io
* Virtual Host Discovery Service (VHDS) is used to dynamically update the list of virtual hosts for
* a given RouteConfiguration. If VHDS is configured a virtual host list update will be triggered
* during the processing of an HTTP request if a route for the request cannot be resolved. The
* :ref:`resource_names_subscribe &lt;envoy_api_msg_DeltaDiscoveryRequest.resource_names_subscribe&gt;`
* :ref:`resource_names_subscribe &lt;envoy_api_field_DeltaDiscoveryRequest.resource_names_subscribe&gt;`
* field contains a list of virtual host names or aliases to track. The contents of an alias would
* be the contents of a *host* or *authority* header used to make an http request. An xDS server
* will match an alias to a virtual host based on the content of :ref:`domains'
* &lt;envoy_api_msg_route.VirtualHost.domains&gt;` field. The *resource_names_unsubscribe* field contains
* a list of virtual host names that have been :ref:`unsubscribed &lt;xds_protocol_unsubscribe&gt;`
* from the routing table associated with the RouteConfiguration.
* &lt;envoy_api_field_route.VirtualHost.domains&gt;` field. The *resource_names_unsubscribe* field
* contains a list of virtual host names that have been :ref:`unsubscribed
* &lt;xds_protocol_unsubscribe&gt;` from the routing table associated with the RouteConfiguration.
* </pre>
*/
public static abstract class VirtualHostDiscoveryServiceImplBase implements io.grpc.BindableService {
Expand Down Expand Up @@ -155,13 +155,13 @@ public io.grpc.stub.StreamObserver<io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequ
* Virtual Host Discovery Service (VHDS) is used to dynamically update the list of virtual hosts for
* a given RouteConfiguration. If VHDS is configured a virtual host list update will be triggered
* during the processing of an HTTP request if a route for the request cannot be resolved. The
* :ref:`resource_names_subscribe &lt;envoy_api_msg_DeltaDiscoveryRequest.resource_names_subscribe&gt;`
* :ref:`resource_names_subscribe &lt;envoy_api_field_DeltaDiscoveryRequest.resource_names_subscribe&gt;`
* field contains a list of virtual host names or aliases to track. The contents of an alias would
* be the contents of a *host* or *authority* header used to make an http request. An xDS server
* will match an alias to a virtual host based on the content of :ref:`domains'
* &lt;envoy_api_msg_route.VirtualHost.domains&gt;` field. The *resource_names_unsubscribe* field contains
* a list of virtual host names that have been :ref:`unsubscribed &lt;xds_protocol_unsubscribe&gt;`
* from the routing table associated with the RouteConfiguration.
* &lt;envoy_api_field_route.VirtualHost.domains&gt;` field. The *resource_names_unsubscribe* field
* contains a list of virtual host names that have been :ref:`unsubscribed
* &lt;xds_protocol_unsubscribe&gt;` from the routing table associated with the RouteConfiguration.
* </pre>
*/
public static final class VirtualHostDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub<VirtualHostDiscoveryServiceStub> {
Expand Down Expand Up @@ -190,13 +190,13 @@ public io.grpc.stub.StreamObserver<io.envoyproxy.envoy.api.v2.DeltaDiscoveryRequ
* Virtual Host Discovery Service (VHDS) is used to dynamically update the list of virtual hosts for
* a given RouteConfiguration. If VHDS is configured a virtual host list update will be triggered
* during the processing of an HTTP request if a route for the request cannot be resolved. The
* :ref:`resource_names_subscribe &lt;envoy_api_msg_DeltaDiscoveryRequest.resource_names_subscribe&gt;`
* :ref:`resource_names_subscribe &lt;envoy_api_field_DeltaDiscoveryRequest.resource_names_subscribe&gt;`
* field contains a list of virtual host names or aliases to track. The contents of an alias would
* be the contents of a *host* or *authority* header used to make an http request. An xDS server
* will match an alias to a virtual host based on the content of :ref:`domains'
* &lt;envoy_api_msg_route.VirtualHost.domains&gt;` field. The *resource_names_unsubscribe* field contains
* a list of virtual host names that have been :ref:`unsubscribed &lt;xds_protocol_unsubscribe&gt;`
* from the routing table associated with the RouteConfiguration.
* &lt;envoy_api_field_route.VirtualHost.domains&gt;` field. The *resource_names_unsubscribe* field
* contains a list of virtual host names that have been :ref:`unsubscribed
* &lt;xds_protocol_unsubscribe&gt;` from the routing table associated with the RouteConfiguration.
* </pre>
*/
public static final class VirtualHostDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<VirtualHostDiscoveryServiceBlockingStub> {
Expand All @@ -217,13 +217,13 @@ protected VirtualHostDiscoveryServiceBlockingStub build(
* Virtual Host Discovery Service (VHDS) is used to dynamically update the list of virtual hosts for
* a given RouteConfiguration. If VHDS is configured a virtual host list update will be triggered
* during the processing of an HTTP request if a route for the request cannot be resolved. The
* :ref:`resource_names_subscribe &lt;envoy_api_msg_DeltaDiscoveryRequest.resource_names_subscribe&gt;`
* :ref:`resource_names_subscribe &lt;envoy_api_field_DeltaDiscoveryRequest.resource_names_subscribe&gt;`
* field contains a list of virtual host names or aliases to track. The contents of an alias would
* be the contents of a *host* or *authority* header used to make an http request. An xDS server
* will match an alias to a virtual host based on the content of :ref:`domains'
* &lt;envoy_api_msg_route.VirtualHost.domains&gt;` field. The *resource_names_unsubscribe* field contains
* a list of virtual host names that have been :ref:`unsubscribed &lt;xds_protocol_unsubscribe&gt;`
* from the routing table associated with the RouteConfiguration.
* &lt;envoy_api_field_route.VirtualHost.domains&gt;` field. The *resource_names_unsubscribe* field
* contains a list of virtual host names that have been :ref:`unsubscribed
* &lt;xds_protocol_unsubscribe&gt;` from the routing table associated with the RouteConfiguration.
* </pre>
*/
public static final class VirtualHostDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub<VirtualHostDiscoveryServiceFutureStub> {
Expand Down
1 change: 1 addition & 0 deletions xds/src/main/java/io/grpc/xds/Bootstrapper.java
Expand Up @@ -74,6 +74,7 @@ public static Bootstrapper getInstance() {
public abstract BootstrapInfo readBootstrap() throws IOException;

@VisibleForTesting
@SuppressWarnings("deprecation")
static BootstrapInfo parseConfig(String rawData) throws IOException {
XdsLogger logger = XdsLogger.withPrefix(LOG_PREFIX);
logger.log(XdsLogLevel.INFO, "Reading bootstrap information");
Expand Down
5 changes: 5 additions & 0 deletions xds/src/test/java/io/grpc/xds/BootstrapperTest.java
Expand Up @@ -41,6 +41,7 @@ public class BootstrapperTest {
@Rule public ExpectedException thrown = ExpectedException.none();

@Test
@SuppressWarnings("deprecation")
public void parseBootstrap_validData_singleXdsServer() throws IOException {
String rawData = "{\n"
+ " \"node\": {\n"
Expand Down Expand Up @@ -96,6 +97,7 @@ public void parseBootstrap_validData_singleXdsServer() throws IOException {
}

@Test
@SuppressWarnings("deprecation")
public void parseBootstrap_validData_multipleXdsServers() throws IOException {
String rawData = "{\n"
+ " \"node\": {\n"
Expand Down Expand Up @@ -160,6 +162,7 @@ public void parseBootstrap_validData_multipleXdsServers() throws IOException {
}

@Test
@SuppressWarnings("deprecation")
public void parseBootstrap_IgnoreIrrelevantFields() throws IOException {
String rawData = "{\n"
+ " \"node\": {\n"
Expand Down Expand Up @@ -225,6 +228,7 @@ public void parseBootstrap_emptyData() throws IOException {
}

@Test
@SuppressWarnings("deprecation")
public void parseBootstrap_minimumRequiredFields() throws IOException {
String rawData = "{\n"
+ " \"xds_servers\": []\n"
Expand All @@ -241,6 +245,7 @@ public void parseBootstrap_minimumRequiredFields() throws IOException {
}

@Test
@SuppressWarnings("deprecation")
public void parseBootstrap_minimalUsableData() throws IOException {
String rawData = "{\n"
+ " \"xds_servers\": [\n"
Expand Down
Expand Up @@ -107,6 +107,7 @@ private static FilterChain createOutFilter() {
return filterChain;
}

@SuppressWarnings("deprecation")
private static FilterChain createInFilter() {
FilterChain filterChain =
FilterChain.newBuilder()
Expand Down
1 change: 1 addition & 0 deletions xds/src/test/java/io/grpc/xds/XdsClientTestHelper.java
Expand Up @@ -125,6 +125,7 @@ static Cluster buildCluster(String clusterName, @Nullable String edsServiceName,
return buildSecureCluster(clusterName, edsServiceName, enableLrs, null);
}

@SuppressWarnings("deprecation")
static Cluster buildSecureCluster(String clusterName, @Nullable String edsServiceName,
boolean enableLrs, @Nullable UpstreamTlsContext upstreamTlsContext) {
Cluster.Builder clusterBuilder = Cluster.newBuilder();
Expand Down
Expand Up @@ -77,6 +77,7 @@ static CommonTlsContext buildCommonTlsContextFromSdsConfigForTlsCertificate(
}

/** takes additional values and creates CombinedCertificateValidationContext as needed. */
@SuppressWarnings("deprecation")
static CommonTlsContext buildCommonTlsContextWithAdditionalValues(
String certName,
String certTargetUri,
Expand Down
Expand Up @@ -68,6 +68,7 @@ public class SdsClientFileBasedMetadataTest {
private SdsSecretConfig sdsSecretConfig;
private File tempTokenFile;

@SuppressWarnings("deprecation")
static ConfigSource buildConfigSourceWithCreds(
String targetUri,
String channelType,
Expand Down
Expand Up @@ -93,6 +93,7 @@ public void emptySanListContextTest() throws CertificateException, IOException {
}

@Test
@SuppressWarnings("deprecation")
public void missingPeerCerts() throws CertificateException, FileNotFoundException {
CertificateValidationContext certContext =
CertificateValidationContext.newBuilder().addVerifySubjectAltName("foo.com").build();
Expand All @@ -106,6 +107,7 @@ public void missingPeerCerts() throws CertificateException, FileNotFoundExceptio
}

@Test
@SuppressWarnings("deprecation")
public void emptyArrayPeerCerts() throws CertificateException, FileNotFoundException {
CertificateValidationContext certContext =
CertificateValidationContext.newBuilder().addVerifySubjectAltName("foo.com").build();
Expand All @@ -119,6 +121,7 @@ public void emptyArrayPeerCerts() throws CertificateException, FileNotFoundExcep
}

@Test
@SuppressWarnings("deprecation")
public void noSansInPeerCerts() throws CertificateException, IOException {
CertificateValidationContext certContext =
CertificateValidationContext.newBuilder().addVerifySubjectAltName("foo.com").build();
Expand All @@ -134,6 +137,7 @@ public void noSansInPeerCerts() throws CertificateException, IOException {
}

@Test
@SuppressWarnings("deprecation")
public void oneSanInPeerCertsVerifies() throws CertificateException, IOException {
CertificateValidationContext certContext =
CertificateValidationContext.newBuilder()
Expand All @@ -146,6 +150,7 @@ public void oneSanInPeerCertsVerifies() throws CertificateException, IOException
}

@Test
@SuppressWarnings("deprecation")
public void oneSanInPeerCertsVerifiesMultipleVerifySans()
throws CertificateException, IOException {
CertificateValidationContext certContext =
Expand All @@ -160,6 +165,7 @@ public void oneSanInPeerCertsVerifiesMultipleVerifySans()
}

@Test
@SuppressWarnings("deprecation")
public void oneSanInPeerCertsNotFoundException()
throws CertificateException, IOException {
CertificateValidationContext certContext =
Expand All @@ -176,6 +182,7 @@ public void oneSanInPeerCertsNotFoundException()
}

@Test
@SuppressWarnings("deprecation")
public void wildcardSanInPeerCertsVerifiesMultipleVerifySans()
throws CertificateException, IOException {
CertificateValidationContext certContext =
Expand All @@ -190,6 +197,7 @@ public void wildcardSanInPeerCertsVerifiesMultipleVerifySans()
}

@Test
@SuppressWarnings("deprecation")
public void wildcardSanInPeerCertsVerifiesMultipleVerifySans1()
throws CertificateException, IOException {
CertificateValidationContext certContext =
Expand All @@ -204,6 +212,7 @@ public void wildcardSanInPeerCertsVerifiesMultipleVerifySans1()
}

@Test
@SuppressWarnings("deprecation")
public void wildcardSanInPeerCertsSubdomainMismatch()
throws CertificateException, IOException {
// 2. Asterisk (*) cannot match across domain name labels.
Expand All @@ -225,6 +234,7 @@ public void wildcardSanInPeerCertsSubdomainMismatch()
}

@Test
@SuppressWarnings("deprecation")
public void oneIpAddressInPeerCertsVerifies() throws CertificateException, IOException {
CertificateValidationContext certContext =
CertificateValidationContext.newBuilder()
Expand All @@ -238,6 +248,7 @@ public void oneIpAddressInPeerCertsVerifies() throws CertificateException, IOExc
}

@Test
@SuppressWarnings("deprecation")
public void oneIpAddressInPeerCertsMismatch() throws CertificateException, IOException {
CertificateValidationContext certContext =
CertificateValidationContext.newBuilder()
Expand Down
16 changes: 15 additions & 1 deletion xds/third_party/envoy/import.sh
Expand Up @@ -18,14 +18,17 @@
set -e
BRANCH=master
# import VERSION from one of the google internal CLs
VERSION=f709434b37e9ff74666d5b854aa11fb2f1ec37f3
VERSION=c0ab3a4374144728c1e193fc2d43951ed36ccdb7
GIT_REPO="https://github.com/envoyproxy/envoy.git"
GIT_BASE_DIR=envoy
SOURCE_PROTO_BASE_DIR=envoy/api
TARGET_PROTO_BASE_DIR=src/main/proto
FILES=(
envoy/annotations/deprecation.proto
envoy/annotations/resource.proto
envoy/api/v2/auth/cert.proto
envoy/api/v2/cds.proto
envoy/api/v2/cluster.proto
envoy/api/v2/cluster/circuit_breaker.proto
envoy/api/v2/cluster/filter.proto
envoy/api/v2/cluster/outlier_detection.proto
Expand All @@ -38,24 +41,35 @@ envoy/api/v2/core/http_uri.proto
envoy/api/v2/core/protocol.proto
envoy/api/v2/discovery.proto
envoy/api/v2/eds.proto
envoy/api/v2/endpoint.proto
envoy/api/v2/endpoint/endpoint.proto
envoy/api/v2/endpoint/endpoint_components.proto
envoy/api/v2/endpoint/load_report.proto
envoy/api/v2/lds.proto
envoy/api/v2/listener.proto
envoy/api/v2/listener/listener.proto
envoy/api/v2/listener/listener_components.proto
envoy/api/v2/listener/udp_listener_config.proto
envoy/api/v2/rds.proto
envoy/api/v2/route.proto
envoy/api/v2/route/route.proto
envoy/api/v2/route/route_components.proto
envoy/api/v2/scoped_route.proto
envoy/api/v2/srds.proto
envoy/config/filter/accesslog/v2/accesslog.proto
envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto
envoy/config/listener/v2/api_listener.proto
envoy/service/discovery/v2/ads.proto
envoy/service/discovery/v2/sds.proto
envoy/service/load_stats/v2/lrs.proto
envoy/type/http.proto
envoy/type/matcher/regex.proto
envoy/type/matcher/string.proto
envoy/type/metadata/v2/metadata.proto
envoy/type/percent.proto
envoy/type/range.proto
envoy/type/semantic_version.proto
envoy/type/tracing/v2/custom_tag.proto
)

# clone the envoy github repo in a tmp directory
Expand Down
@@ -0,0 +1,22 @@
syntax = "proto3";

package envoy.annotations;

import "google/protobuf/descriptor.proto";

// [#protodoc-title: Deprecation]
// Allows tagging proto fields as fatal by default. One Envoy release after
// deprecation, deprecated fields will be disallowed by default, a state which
// is reversible with :ref:`runtime overrides <config_runtime_deprecation>`.

// Magic number in this file derived from top 28bit of SHA256 digest of
// "envoy.annotation.disallowed_by_default"
extend google.protobuf.FieldOptions {
bool disallowed_by_default = 189503207;
}

// Magic number in this file derived from top 28bit of SHA256 digest of
// "envoy.annotation.disallowed_by_default_enum"
extend google.protobuf.EnumValueOptions {
bool disallowed_by_default_enum = 70100853;
}
@@ -0,0 +1,18 @@
syntax = "proto3";

package envoy.annotations;

import "google/protobuf/descriptor.proto";

// [#protodoc-title: Resource]

// Magic number in this file derived from top 28bit of SHA256 digest of "envoy.annotation.resource".
extend google.protobuf.ServiceOptions {
ResourceAnnotation resource = 265073217;
}

message ResourceAnnotation {
// Annotation for xDS services that indicates the fully-qualified Protobuf type for the resource
// type.
string type = 1;
}

0 comments on commit 2ec86c1

Please sign in to comment.