diff --git a/xds/build.gradle b/xds/build.gradle index 3af4f75d62c..16b1c877906 100644 --- a/xds/build.gradle +++ b/xds/build.gradle @@ -71,7 +71,7 @@ sourceSets { proto { srcDir 'third_party/envoy/src/main/proto' srcDir 'third_party/protoc-gen-validate/src/main/proto' - srcDir 'third_party/udpa/src/main/proto' + srcDir 'third_party/xds/src/main/proto' srcDir 'third_party/googleapis/src/main/proto' srcDir 'third_party/istio/src/main/proto' } @@ -92,6 +92,7 @@ jar { javadoc { // Exclusions here should generally also be relocated exclude 'com/github/udpa/**' + exclude 'com/github/xds/**' exclude 'com/google/security/**' exclude 'io/envoyproxy/**' // Need to clean up the class structure to reduce how much is exposed @@ -115,6 +116,7 @@ shadowJar { } // Relocated packages commonly need exclusions in jacocoTestReport and javadoc relocate 'com.github.udpa', "${prefixName}.shaded.com.github.udpa" + relocate 'com.github.xds', "${prefixName}.shaded.com.github.xds" relocate 'com.google.api.expr', "${prefixName}.shaded.com.google.api.expr" relocate 'com.google.security', "${prefixName}.shaded.com.google.security" // TODO: missing java_package option in .proto @@ -124,6 +126,7 @@ shadowJar { relocate 'io.netty', 'io.grpc.netty.shaded.io.netty' // TODO: missing java_package option in .proto relocate 'udpa.annotations', "${prefixName}.shaded.udpa.annotations" + relocate 'xds.annotations', "${prefixName}.shaded.xds.annotations" exclude "**/*.proto" } @@ -159,11 +162,13 @@ jacocoTestReport { fileTree(dir: it, exclude: [ // Exclusions here should generally also be relocated '**/com/github/udpa/**', + '**/com/github/xds/**', '**/com/google/api/expr/**', '**/com/google/security/**', '**/envoy/annotations/**', '**/io/envoyproxy/**', '**/udpa/annotations/**', + '**/xds/annotations/**', ]) } } diff --git a/xds/src/generated/main/grpc/com/github/udpa/udpa/service/orca/v1/OpenRcaServiceGrpc.java b/xds/src/generated/main/grpc/com/github/xds/service/orca/v3/OpenRcaServiceGrpc.java similarity index 83% rename from xds/src/generated/main/grpc/com/github/udpa/udpa/service/orca/v1/OpenRcaServiceGrpc.java rename to xds/src/generated/main/grpc/com/github/xds/service/orca/v3/OpenRcaServiceGrpc.java index 78383dba2d3..52ec6898808 100644 --- a/xds/src/generated/main/grpc/com/github/udpa/udpa/service/orca/v1/OpenRcaServiceGrpc.java +++ b/xds/src/generated/main/grpc/com/github/xds/service/orca/v3/OpenRcaServiceGrpc.java @@ -1,4 +1,4 @@ -package com.github.udpa.udpa.service.orca.v1; +package com.github.xds.service.orca.v3; import static io.grpc.MethodDescriptor.generateFullMethodName; @@ -16,38 +16,38 @@ */ @javax.annotation.Generated( value = "by gRPC proto compiler", - comments = "Source: udpa/service/orca/v1/orca.proto") + comments = "Source: xds/service/orca/v3/orca.proto") @io.grpc.stub.annotations.GrpcGenerated public final class OpenRcaServiceGrpc { private OpenRcaServiceGrpc() {} - public static final String SERVICE_NAME = "udpa.service.orca.v1.OpenRcaService"; + public static final String SERVICE_NAME = "xds.service.orca.v3.OpenRcaService"; // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getStreamCoreMetricsMethod; + private static volatile io.grpc.MethodDescriptor getStreamCoreMetricsMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "StreamCoreMetrics", - requestType = com.github.udpa.udpa.service.orca.v1.OrcaLoadReportRequest.class, - responseType = com.github.udpa.udpa.data.orca.v1.OrcaLoadReport.class, + requestType = com.github.xds.service.orca.v3.OrcaLoadReportRequest.class, + responseType = com.github.xds.data.orca.v3.OrcaLoadReport.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - public static io.grpc.MethodDescriptor getStreamCoreMetricsMethod() { - io.grpc.MethodDescriptor getStreamCoreMetricsMethod; + public static io.grpc.MethodDescriptor getStreamCoreMetricsMethod() { + io.grpc.MethodDescriptor getStreamCoreMetricsMethod; if ((getStreamCoreMetricsMethod = OpenRcaServiceGrpc.getStreamCoreMetricsMethod) == null) { synchronized (OpenRcaServiceGrpc.class) { if ((getStreamCoreMetricsMethod = OpenRcaServiceGrpc.getStreamCoreMetricsMethod) == null) { OpenRcaServiceGrpc.getStreamCoreMetricsMethod = getStreamCoreMetricsMethod = - io.grpc.MethodDescriptor.newBuilder() + io.grpc.MethodDescriptor.newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamCoreMetrics")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.github.udpa.udpa.service.orca.v1.OrcaLoadReportRequest.getDefaultInstance())) + com.github.xds.service.orca.v3.OrcaLoadReportRequest.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.github.udpa.udpa.data.orca.v1.OrcaLoadReport.getDefaultInstance())) + com.github.xds.data.orca.v3.OrcaLoadReport.getDefaultInstance())) .setSchemaDescriptor(new OpenRcaServiceMethodDescriptorSupplier("StreamCoreMetrics")) .build(); } @@ -116,8 +116,8 @@ public static abstract class OpenRcaServiceImplBase implements io.grpc.BindableS /** */ - public void streamCoreMetrics(com.github.udpa.udpa.service.orca.v1.OrcaLoadReportRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void streamCoreMetrics(com.github.xds.service.orca.v3.OrcaLoadReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStreamCoreMetricsMethod(), responseObserver); } @@ -127,8 +127,8 @@ public void streamCoreMetrics(com.github.udpa.udpa.service.orca.v1.OrcaLoadRepor getStreamCoreMetricsMethod(), io.grpc.stub.ServerCalls.asyncServerStreamingCall( new MethodHandlers< - com.github.udpa.udpa.service.orca.v1.OrcaLoadReportRequest, - com.github.udpa.udpa.data.orca.v1.OrcaLoadReport>( + com.github.xds.service.orca.v3.OrcaLoadReportRequest, + com.github.xds.data.orca.v3.OrcaLoadReport>( this, METHODID_STREAM_CORE_METRICS))) .build(); } @@ -160,8 +160,8 @@ protected OpenRcaServiceStub build( /** */ - public void streamCoreMetrics(com.github.udpa.udpa.service.orca.v1.OrcaLoadReportRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void streamCoreMetrics(com.github.xds.service.orca.v3.OrcaLoadReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncServerStreamingCall( getChannel().newCall(getStreamCoreMetricsMethod(), getCallOptions()), request, responseObserver); } @@ -193,8 +193,8 @@ protected OpenRcaServiceBlockingStub build( /** */ - public java.util.Iterator streamCoreMetrics( - com.github.udpa.udpa.service.orca.v1.OrcaLoadReportRequest request) { + public java.util.Iterator streamCoreMetrics( + com.github.xds.service.orca.v3.OrcaLoadReportRequest request) { return io.grpc.stub.ClientCalls.blockingServerStreamingCall( getChannel(), getStreamCoreMetricsMethod(), getCallOptions(), request); } @@ -245,8 +245,8 @@ private static final class MethodHandlers implements public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { case METHODID_STREAM_CORE_METRICS: - serviceImpl.streamCoreMetrics((com.github.udpa.udpa.service.orca.v1.OrcaLoadReportRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); + serviceImpl.streamCoreMetrics((com.github.xds.service.orca.v3.OrcaLoadReportRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); break; default: throw new AssertionError(); @@ -270,7 +270,7 @@ private static abstract class OpenRcaServiceBaseDescriptorSupplier @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.github.udpa.udpa.service.orca.v1.OrcaProto.getDescriptor(); + return com.github.xds.service.orca.v3.OrcaProto.getDescriptor(); } @java.lang.Override diff --git a/xds/src/main/java/io/grpc/xds/ClientXdsClient.java b/xds/src/main/java/io/grpc/xds/ClientXdsClient.java index 4d45dc21d9e..0a11ad47288 100644 --- a/xds/src/main/java/io/grpc/xds/ClientXdsClient.java +++ b/xds/src/main/java/io/grpc/xds/ClientXdsClient.java @@ -162,8 +162,10 @@ final class ClientXdsClient extends XdsClient implements XdsResponseHandler, Res "type.googleapis.com/envoy.config.cluster.aggregate.v2alpha.ClusterConfig"; private static final String TYPE_URL_CLUSTER_CONFIG = "type.googleapis.com/envoy.extensions.clusters.aggregate.v3.ClusterConfig"; - private static final String TYPE_URL_TYPED_STRUCT = + private static final String TYPE_URL_TYPED_STRUCT_UDPA = "type.googleapis.com/udpa.type.v1.TypedStruct"; + private static final String TYPE_URL_TYPED_STRUCT = + "type.googleapis.com/xds.type.v3.TypedStruct"; private static final String TYPE_URL_FILTER_CONFIG = "type.googleapis.com/envoy.config.route.v3.FilterConfig"; // TODO(zdapeng): need to discuss how to handle unsupported values. @@ -908,16 +910,21 @@ static StructOrError parseHttpFilter( } Message rawConfig = httpFilter.getTypedConfig(); String typeUrl = httpFilter.getTypedConfig().getTypeUrl(); - if (typeUrl.equals(TYPE_URL_TYPED_STRUCT)) { - TypedStruct typedStruct; - try { - typedStruct = httpFilter.getTypedConfig().unpack(TypedStruct.class); - } catch (InvalidProtocolBufferException e) { - return StructOrError.fromError( - "HttpFilter [" + filterName + "] contains invalid proto: " + e); + + try { + if (typeUrl.equals(TYPE_URL_TYPED_STRUCT_UDPA)) { + TypedStruct typedStruct = httpFilter.getTypedConfig().unpack(TypedStruct.class); + typeUrl = typedStruct.getTypeUrl(); + rawConfig = typedStruct.getValue(); + } else if (typeUrl.equals(TYPE_URL_TYPED_STRUCT)) { + com.github.xds.type.v3.TypedStruct newTypedStruct = + httpFilter.getTypedConfig().unpack(com.github.xds.type.v3.TypedStruct.class); + typeUrl = newTypedStruct.getTypeUrl(); + rawConfig = newTypedStruct.getValue(); } - typeUrl = typedStruct.getTypeUrl(); - rawConfig = typedStruct.getValue(); + } catch (InvalidProtocolBufferException e) { + return StructOrError.fromError( + "HttpFilter [" + filterName + "] contains invalid proto: " + e); } Filter filter = filterRegistry.get(typeUrl); if ((isForClient && !(filter instanceof ClientInterceptorBuilder)) @@ -991,16 +998,20 @@ static StructOrError> parseOverrideFilterConfigs( typeUrl = anyConfig.getTypeUrl(); } Message rawConfig = anyConfig; - if (typeUrl.equals(TYPE_URL_TYPED_STRUCT)) { - TypedStruct typedStruct; - try { - typedStruct = anyConfig.unpack(TypedStruct.class); - } catch (InvalidProtocolBufferException e) { - return StructOrError.fromError( - "FilterConfig [" + name + "] contains invalid proto: " + e); + try { + if (typeUrl.equals(TYPE_URL_TYPED_STRUCT_UDPA)) { + TypedStruct typedStruct = anyConfig.unpack(TypedStruct.class); + typeUrl = typedStruct.getTypeUrl(); + rawConfig = typedStruct.getValue(); + } else if (typeUrl.equals(TYPE_URL_TYPED_STRUCT)) { + com.github.xds.type.v3.TypedStruct newTypedStruct = + anyConfig.unpack(com.github.xds.type.v3.TypedStruct.class); + typeUrl = newTypedStruct.getTypeUrl(); + rawConfig = newTypedStruct.getValue(); } - typeUrl = typedStruct.getTypeUrl(); - rawConfig = typedStruct.getValue(); + } catch (InvalidProtocolBufferException e) { + return StructOrError.fromError( + "FilterConfig [" + name + "] contains invalid proto: " + e); } Filter filter = filterRegistry.get(typeUrl); if (filter == null) { diff --git a/xds/src/main/java/io/grpc/xds/OrcaMetricReportingServerInterceptor.java b/xds/src/main/java/io/grpc/xds/OrcaMetricReportingServerInterceptor.java index 8a503bd35f9..9c79ed11bc3 100644 --- a/xds/src/main/java/io/grpc/xds/OrcaMetricReportingServerInterceptor.java +++ b/xds/src/main/java/io/grpc/xds/OrcaMetricReportingServerInterceptor.java @@ -16,7 +16,7 @@ package io.grpc.xds; -import com.github.udpa.udpa.data.orca.v1.OrcaLoadReport; +import com.github.xds.data.orca.v3.OrcaLoadReport; import com.google.common.annotations.VisibleForTesting; import io.grpc.Context; import io.grpc.Contexts; diff --git a/xds/src/main/java/io/grpc/xds/OrcaOobUtil.java b/xds/src/main/java/io/grpc/xds/OrcaOobUtil.java index 1b5acd8c080..8970a68bf65 100644 --- a/xds/src/main/java/io/grpc/xds/OrcaOobUtil.java +++ b/xds/src/main/java/io/grpc/xds/OrcaOobUtil.java @@ -22,9 +22,9 @@ import static io.grpc.ConnectivityState.READY; import static io.grpc.ConnectivityState.SHUTDOWN; -import com.github.udpa.udpa.data.orca.v1.OrcaLoadReport; -import com.github.udpa.udpa.service.orca.v1.OpenRcaServiceGrpc; -import com.github.udpa.udpa.service.orca.v1.OrcaLoadReportRequest; +import com.github.xds.data.orca.v3.OrcaLoadReport; +import com.github.xds.service.orca.v3.OpenRcaServiceGrpc; +import com.github.xds.service.orca.v3.OrcaLoadReportRequest; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; diff --git a/xds/src/main/java/io/grpc/xds/OrcaPerRequestUtil.java b/xds/src/main/java/io/grpc/xds/OrcaPerRequestUtil.java index 156d53f638e..4b4cff92064 100644 --- a/xds/src/main/java/io/grpc/xds/OrcaPerRequestUtil.java +++ b/xds/src/main/java/io/grpc/xds/OrcaPerRequestUtil.java @@ -18,7 +18,7 @@ import static com.google.common.base.Preconditions.checkNotNull; -import com.github.udpa.udpa.data.orca.v1.OrcaLoadReport; +import com.github.xds.data.orca.v3.OrcaLoadReport; import com.google.common.annotations.VisibleForTesting; import io.grpc.CallOptions; import io.grpc.ClientStreamTracer; diff --git a/xds/src/test/java/io/grpc/xds/ClientXdsClientDataTest.java b/xds/src/test/java/io/grpc/xds/ClientXdsClientDataTest.java index cb7b937bb5f..e14d6db45ac 100644 --- a/xds/src/test/java/io/grpc/xds/ClientXdsClientDataTest.java +++ b/xds/src/test/java/io/grpc/xds/ClientXdsClientDataTest.java @@ -18,14 +18,18 @@ import static com.google.common.truth.Truth.assertThat; +import com.github.xds.type.v3.TypedStruct; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.protobuf.Any; import com.google.protobuf.BoolValue; import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.Message; import com.google.protobuf.StringValue; +import com.google.protobuf.Struct; import com.google.protobuf.UInt32Value; import com.google.protobuf.UInt64Value; +import com.google.protobuf.Value; import com.google.protobuf.util.Durations; import com.google.re2j.Pattern; import io.envoyproxy.envoy.config.cluster.v3.Cluster; @@ -94,7 +98,9 @@ import io.envoyproxy.envoy.type.v3.FractionalPercent; import io.envoyproxy.envoy.type.v3.FractionalPercent.DenominatorType; import io.envoyproxy.envoy.type.v3.Int64Range; +import io.grpc.ClientInterceptor; import io.grpc.InsecureChannelCredentials; +import io.grpc.LoadBalancer; import io.grpc.Status.Code; import io.grpc.xds.Bootstrapper.ServerInfo; import io.grpc.xds.ClientXdsClient.ResourceInvalidException; @@ -116,7 +122,9 @@ import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; +import javax.annotation.Nullable; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -879,6 +887,107 @@ public void parseHttpFilter_unsupportedButOptional() { assertThat(ClientXdsClient.parseHttpFilter(httpFilter, filterRegistry, true)).isNull(); } + private static class SimpleFilterConfig implements FilterConfig { + private final Message message; + + public SimpleFilterConfig(Message rawProtoMessage) { + message = rawProtoMessage; + } + + public Message getConfig() { + return message; + } + + @Override + public String typeUrl() { + return null; + } + } + + private static class TestFilter implements io.grpc.xds.Filter, + io.grpc.xds.Filter.ClientInterceptorBuilder { + @Override + public String[] typeUrls() { + return new String[]{"test-url"}; + } + + @Override + public ConfigOrError parseFilterConfig(Message rawProtoMessage) { + return ConfigOrError.fromConfig(new SimpleFilterConfig(rawProtoMessage)); + } + + @Override + public ConfigOrError parseFilterConfigOverride( + Message rawProtoMessage) { + return ConfigOrError.fromConfig(new SimpleFilterConfig(rawProtoMessage)); + } + + @Nullable + @Override + public ClientInterceptor buildClientInterceptor(FilterConfig config, + @Nullable FilterConfig overrideConfig, + LoadBalancer.PickSubchannelArgs args, + ScheduledExecutorService scheduler) { + return null; + } + } + + @Test + public void parseHttpFilter_typedStructMigration() { + filterRegistry.register(new TestFilter()); + Struct rawStruct = Struct.newBuilder() + .putFields("name", Value.newBuilder().setStringValue("default").build()) + .build(); + HttpFilter httpFilter = HttpFilter.newBuilder() + .setIsOptional(true) + .setTypedConfig(Any.pack( + com.github.udpa.udpa.type.v1.TypedStruct.newBuilder() + .setTypeUrl("test-url") + .setValue(rawStruct) + .build())).build(); + FilterConfig config = ClientXdsClient.parseHttpFilter(httpFilter, filterRegistry, + true).getStruct(); + assertThat(((SimpleFilterConfig)config).getConfig()).isEqualTo(rawStruct); + + HttpFilter httpFilterNewTypeStruct = HttpFilter.newBuilder() + .setIsOptional(true) + .setTypedConfig(Any.pack( + TypedStruct.newBuilder() + .setTypeUrl("test-url") + .setValue(rawStruct) + .build())).build(); + config = ClientXdsClient.parseHttpFilter(httpFilterNewTypeStruct, filterRegistry, + true).getStruct(); + assertThat(((SimpleFilterConfig)config).getConfig()).isEqualTo(rawStruct); + } + + @Test + public void parseOverrideHttpFilter_typedStructMigration() { + filterRegistry.register(new TestFilter()); + Struct rawStruct0 = Struct.newBuilder() + .putFields("name", Value.newBuilder().setStringValue("default0").build()) + .build(); + Struct rawStruct1 = Struct.newBuilder() + .putFields("name", Value.newBuilder().setStringValue("default1").build()) + .build(); + Map rawFilterMap = ImmutableMap.of( + "struct-0", Any.pack( + com.github.udpa.udpa.type.v1.TypedStruct.newBuilder() + .setTypeUrl("test-url") + .setValue(rawStruct0) + .build()), + "struct-1", Any.pack( + TypedStruct.newBuilder() + .setTypeUrl("test-url") + .setValue(rawStruct1) + .build()) + ); + Map map = ClientXdsClient.parseOverrideFilterConfigs(rawFilterMap, + filterRegistry).getStruct(); + assertThat(((SimpleFilterConfig)map.get("struct-0")).getConfig()).isEqualTo(rawStruct0); + assertThat(((SimpleFilterConfig)map.get("struct-1")).getConfig()).isEqualTo(rawStruct1); + } + @Test public void parseHttpFilter_unsupportedAndRequired() { HttpFilter httpFilter = HttpFilter.newBuilder() diff --git a/xds/src/test/java/io/grpc/xds/OrcaMetricReportingServerInterceptorTest.java b/xds/src/test/java/io/grpc/xds/OrcaMetricReportingServerInterceptorTest.java index b59871f5437..4a2074b91d8 100644 --- a/xds/src/test/java/io/grpc/xds/OrcaMetricReportingServerInterceptorTest.java +++ b/xds/src/test/java/io/grpc/xds/OrcaMetricReportingServerInterceptorTest.java @@ -18,7 +18,7 @@ import static com.google.common.truth.Truth.assertThat; -import com.github.udpa.udpa.data.orca.v1.OrcaLoadReport; +import com.github.xds.data.orca.v3.OrcaLoadReport; import io.grpc.CallOptions; import io.grpc.Channel; import io.grpc.ClientCall; diff --git a/xds/src/test/java/io/grpc/xds/OrcaOobUtilTest.java b/xds/src/test/java/io/grpc/xds/OrcaOobUtilTest.java index b3cf80ee617..5f5bc5a69aa 100644 --- a/xds/src/test/java/io/grpc/xds/OrcaOobUtilTest.java +++ b/xds/src/test/java/io/grpc/xds/OrcaOobUtilTest.java @@ -34,9 +34,9 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; -import com.github.udpa.udpa.data.orca.v1.OrcaLoadReport; -import com.github.udpa.udpa.service.orca.v1.OpenRcaServiceGrpc; -import com.github.udpa.udpa.service.orca.v1.OrcaLoadReportRequest; +import com.github.xds.data.orca.v3.OrcaLoadReport; +import com.github.xds.service.orca.v3.OpenRcaServiceGrpc; +import com.github.xds.service.orca.v3.OrcaLoadReportRequest; import com.google.common.util.concurrent.MoreExecutors; import com.google.protobuf.util.Durations; import io.grpc.Attributes; diff --git a/xds/src/test/java/io/grpc/xds/OrcaPerRequestUtilTest.java b/xds/src/test/java/io/grpc/xds/OrcaPerRequestUtilTest.java index bee68c9e634..a6e7c6aca20 100644 --- a/xds/src/test/java/io/grpc/xds/OrcaPerRequestUtilTest.java +++ b/xds/src/test/java/io/grpc/xds/OrcaPerRequestUtilTest.java @@ -27,7 +27,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; -import com.github.udpa.udpa.data.orca.v1.OrcaLoadReport; +import com.github.xds.data.orca.v3.OrcaLoadReport; import io.grpc.ClientStreamTracer; import io.grpc.Metadata; import io.grpc.xds.OrcaPerRequestUtil.OrcaPerRequestReportListener; diff --git a/xds/third_party/udpa/LICENSE b/xds/third_party/xds/LICENSE similarity index 100% rename from xds/third_party/udpa/LICENSE rename to xds/third_party/xds/LICENSE diff --git a/xds/third_party/udpa/import.sh b/xds/third_party/xds/import.sh similarity index 74% rename from xds/third_party/udpa/import.sh rename to xds/third_party/xds/import.sh index b96e4ea6da6..36889a52bba 100755 --- a/xds/third_party/udpa/import.sh +++ b/xds/third_party/xds/import.sh @@ -18,21 +18,29 @@ set -e BRANCH=main # import VERSION from one of the google internal CLs -VERSION=5459f2c994033b0afed7e4a70ac7e90c90c1ffee -GIT_REPO="https://github.com/cncf/udpa.git" -GIT_BASE_DIR=udpa -SOURCE_PROTO_BASE_DIR=udpa +VERSION=cb28da3451f158a947dfc45090fe92b07b243bc1 +GIT_REPO="https://github.com/cncf/xds.git" +GIT_BASE_DIR=xds +SOURCE_PROTO_BASE_DIR=xds TARGET_PROTO_BASE_DIR=src/main/proto # Sorted alphabetically. FILES=( udpa/annotations/migrate.proto +xds/annotations/v3/migrate.proto udpa/annotations/security.proto +xds/annotations/v3/security.proto +udpa/annotations/security.proto +xds/annotations/v3/security.proto udpa/annotations/sensitive.proto +xds/annotations/v3/sensitive.proto udpa/annotations/status.proto +xds/annotations/v3/status.proto udpa/annotations/versioning.proto -udpa/data/orca/v1/orca_load_report.proto -udpa/service/orca/v1/orca.proto +xds/annotations/v3/versioning.proto +xds/data/orca/v3/orca_load_report.proto +xds/service/orca/v3/orca.proto udpa/type/v1/typed_struct.proto +xds/type/v3/typed_struct.proto xds/core/v3/authority.proto xds/core/v3/collection_entry.proto xds/core/v3/context_params.proto @@ -40,9 +48,9 @@ xds/core/v3/resource_locator.proto xds/core/v3/resource_name.proto ) -pushd `git rev-parse --show-toplevel`/xds/third_party/udpa +pushd `git rev-parse --show-toplevel`/xds/third_party/xds -# clone the udpa github repo in a tmp directory +# clone the xds github repo in a tmp directory tmpdir="$(mktemp -d)" trap "rm -rf $tmpdir" EXIT diff --git a/xds/third_party/udpa/src/main/proto/udpa/annotations/migrate.proto b/xds/third_party/xds/src/main/proto/udpa/annotations/migrate.proto similarity index 86% rename from xds/third_party/udpa/src/main/proto/udpa/annotations/migrate.proto rename to xds/third_party/xds/src/main/proto/udpa/annotations/migrate.proto index 1c42a6404dc..5289cb8a742 100644 --- a/xds/third_party/udpa/src/main/proto/udpa/annotations/migrate.proto +++ b/xds/third_party/xds/src/main/proto/udpa/annotations/migrate.proto @@ -1,9 +1,15 @@ +// THIS FILE IS DEPRECATED +// Users should instead use the corresponding proto in the xds tree. +// No new changes will be accepted here. + syntax = "proto3"; package udpa.annotations; import "google/protobuf/descriptor.proto"; +option go_package = "github.com/cncf/xds/go/annotations"; + // Magic number in this file derived from top 28bit of SHA256 digest of // "udpa.annotation.migrate". diff --git a/xds/third_party/udpa/src/main/proto/udpa/annotations/security.proto b/xds/third_party/xds/src/main/proto/udpa/annotations/security.proto similarity index 82% rename from xds/third_party/udpa/src/main/proto/udpa/annotations/security.proto rename to xds/third_party/xds/src/main/proto/udpa/annotations/security.proto index 7191fe30c82..52801d30d1e 100644 --- a/xds/third_party/udpa/src/main/proto/udpa/annotations/security.proto +++ b/xds/third_party/xds/src/main/proto/udpa/annotations/security.proto @@ -1,13 +1,16 @@ +// THIS FILE IS DEPRECATED +// Users should instead use the corresponding proto in the xds tree. +// No new changes will be accepted here. + syntax = "proto3"; package udpa.annotations; import "udpa/annotations/status.proto"; -import "google/protobuf/any.proto"; import "google/protobuf/descriptor.proto"; -import "validate/validate.proto"; +option go_package = "github.com/cncf/xds/go/annotations"; // All annotations in this file are experimental and subject to change. Their // only consumer today is the Envoy APIs and SecuritAnnotationValidator protoc diff --git a/xds/third_party/xds/src/main/proto/udpa/annotations/sensitive.proto b/xds/third_party/xds/src/main/proto/udpa/annotations/sensitive.proto new file mode 100644 index 00000000000..ab822fb4884 --- /dev/null +++ b/xds/third_party/xds/src/main/proto/udpa/annotations/sensitive.proto @@ -0,0 +1,20 @@ +// THIS FILE IS DEPRECATED +// Users should instead use the corresponding proto in the xds tree. +// No new changes will be accepted here. + +syntax = "proto3"; + +package udpa.annotations; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/cncf/xds/go/annotations"; + +extend google.protobuf.FieldOptions { + // Magic number is the 28 most significant bits in the sha256sum of "udpa.annotations.sensitive". + // When set to true, `sensitive` indicates that this field contains sensitive data, such as + // personally identifiable information, passwords, or private keys, and should be redacted for + // display by tools aware of this annotation. Note that that this has no effect on standard + // Protobuf functions such as `TextFormat::PrintToString`. + bool sensitive = 76569463; +} diff --git a/xds/third_party/udpa/src/main/proto/udpa/annotations/status.proto b/xds/third_party/xds/src/main/proto/udpa/annotations/status.proto similarity index 82% rename from xds/third_party/udpa/src/main/proto/udpa/annotations/status.proto rename to xds/third_party/xds/src/main/proto/udpa/annotations/status.proto index 9832ffd3a2f..76cfd4dcfef 100644 --- a/xds/third_party/udpa/src/main/proto/udpa/annotations/status.proto +++ b/xds/third_party/xds/src/main/proto/udpa/annotations/status.proto @@ -1,9 +1,15 @@ +// THIS FILE IS DEPRECATED +// Users should instead use the corresponding proto in the xds tree. +// No new changes will be accepted here. + syntax = "proto3"; package udpa.annotations; import "google/protobuf/descriptor.proto"; +option go_package = "github.com/cncf/xds/go/annotations"; + // Magic number in this file derived from top 28bit of SHA256 digest of // "udpa.annotation.status". extend google.protobuf.FileOptions { diff --git a/xds/third_party/udpa/src/main/proto/udpa/annotations/versioning.proto b/xds/third_party/xds/src/main/proto/udpa/annotations/versioning.proto similarity index 72% rename from xds/third_party/udpa/src/main/proto/udpa/annotations/versioning.proto rename to xds/third_party/xds/src/main/proto/udpa/annotations/versioning.proto index 16f6dc30cad..dcb7c85fd4f 100644 --- a/xds/third_party/udpa/src/main/proto/udpa/annotations/versioning.proto +++ b/xds/third_party/xds/src/main/proto/udpa/annotations/versioning.proto @@ -1,9 +1,15 @@ +// THIS FILE IS DEPRECATED +// Users should instead use the corresponding proto in the xds tree. +// No new changes will be accepted here. + syntax = "proto3"; package udpa.annotations; import "google/protobuf/descriptor.proto"; +option go_package = "github.com/cncf/xds/go/annotations"; + extend google.protobuf.MessageOptions { // Magic number derived from 0x78 ('x') 0x44 ('D') 0x53 ('S') VersioningAnnotation versioning = 7881811; diff --git a/xds/third_party/xds/src/main/proto/udpa/type/v1/typed_struct.proto b/xds/third_party/xds/src/main/proto/udpa/type/v1/typed_struct.proto new file mode 100644 index 00000000000..f96625d926f --- /dev/null +++ b/xds/third_party/xds/src/main/proto/udpa/type/v1/typed_struct.proto @@ -0,0 +1,47 @@ +// THIS FILE IS DEPRECATED +// Users should instead use the corresponding proto in the xds tree. +// No new changes will be accepted here. + +syntax = "proto3"; + +package udpa.type.v1; + +option java_outer_classname = "TypedStructProto"; +option java_multiple_files = true; +option java_package = "com.github.udpa.udpa.type.v1"; +option go_package = "github.com/cncf/xds/go/udpa/type/v1"; + +import "validate/validate.proto"; +import "google/protobuf/struct.proto"; + +// A TypedStruct contains an arbitrary JSON serialized protocol buffer message with a URL that +// describes the type of the serialized message. This is very similar to google.protobuf.Any, +// instead of having protocol buffer binary, this employs google.protobuf.Struct as value. +// +// This message is intended to be embedded inside Any, so it shouldn't be directly referred +// from other UDPA messages. +// +// When packing an opaque extension config, packing the expected type into Any is preferred +// wherever possible for its efficiency. TypedStruct should be used only if a proto descriptor +// is not available, for example if: +// - A control plane sends opaque message that is originally from external source in human readable +// format such as JSON or YAML. +// - The control plane doesn't have the knowledge of the protocol buffer schema hence it cannot +// serialize the message in protocol buffer binary format. +// - The DPLB doesn't have have the knowledge of the protocol buffer schema its plugin or extension +// uses. This has to be indicated in the DPLB capability negotiation. +// +// When a DPLB receives a TypedStruct in Any, it should: +// - Check if the type_url of the TypedStruct matches the type the extension expects. +// - Convert value to the type described in type_url and perform validation. +// TODO(lizan): Figure out how TypeStruct should be used with DPLB extensions that doesn't link +// protobuf descriptor with DPLB itself, (e.g. gRPC LB Plugin, Envoy WASM extensions). +message TypedStruct { + // A URL that uniquely identifies the type of the serialize protocol buffer message. + // This has same semantics and format described in google.protobuf.Any: + // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto + string type_url = 1; + + // A JSON representation of the above specified type. + google.protobuf.Struct value = 2; +} diff --git a/xds/third_party/xds/src/main/proto/xds/annotations/v3/migrate.proto b/xds/third_party/xds/src/main/proto/xds/annotations/v3/migrate.proto new file mode 100644 index 00000000000..13859274c85 --- /dev/null +++ b/xds/third_party/xds/src/main/proto/xds/annotations/v3/migrate.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +package xds.annotations.v3; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/cncf/xds/go/xds/annotations/v3"; + +// Magic number in this file derived from top 28bit of SHA256 digest of +// "xds.annotation.v3.migrate". +extend google.protobuf.MessageOptions { + MigrateAnnotation message_migrate = 112948430; +} +extend google.protobuf.FieldOptions { + FieldMigrateAnnotation field_migrate = 112948430; +} +extend google.protobuf.EnumOptions { + MigrateAnnotation enum_migrate = 112948430; +} +extend google.protobuf.EnumValueOptions { + MigrateAnnotation enum_value_migrate = 112948430; +} +extend google.protobuf.FileOptions { + FileMigrateAnnotation file_migrate = 112948430; +} + +message MigrateAnnotation { + // Rename the message/enum/enum value in next version. + string rename = 1; +} + +message FieldMigrateAnnotation { + // Rename the field in next version. + string rename = 1; + + // Add the field to a named oneof in next version. If this already exists, the + // field will join its siblings under the oneof, otherwise a new oneof will be + // created with the given name. + string oneof_promotion = 2; +} + +message FileMigrateAnnotation { + // Move all types in the file to another package, this implies changing proto + // file path. + string move_to_package = 2; +} diff --git a/xds/third_party/xds/src/main/proto/xds/annotations/v3/security.proto b/xds/third_party/xds/src/main/proto/xds/annotations/v3/security.proto new file mode 100644 index 00000000000..f1f9f40da0a --- /dev/null +++ b/xds/third_party/xds/src/main/proto/xds/annotations/v3/security.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package xds.annotations.v3; + +import "xds/annotations/v3/status.proto"; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/cncf/xds/go/xds/annotations/v3"; + +// All annotations in this file are experimental and subject to change. Their +// only consumer today is the Envoy APIs and SecuritAnnotationValidator protoc +// plugin in this repository. +option (xds.annotations.v3.file_status).work_in_progress = true; + +extend google.protobuf.FieldOptions { + // Magic number is the 28 most significant bits in the sha256sum of + // "xds.annotations.v3.security". + FieldSecurityAnnotation security = 99044135; +} + +// These annotations indicate metadata for the purpose of understanding the +// security significance of fields. +message FieldSecurityAnnotation { + // Field should be set in the presence of untrusted downstreams. + bool configure_for_untrusted_downstream = 1; + + // Field should be set in the presence of untrusted upstreams. + bool configure_for_untrusted_upstream = 2; +} diff --git a/xds/third_party/udpa/src/main/proto/udpa/annotations/sensitive.proto b/xds/third_party/xds/src/main/proto/xds/annotations/v3/sensitive.proto similarity index 76% rename from xds/third_party/udpa/src/main/proto/udpa/annotations/sensitive.proto rename to xds/third_party/xds/src/main/proto/xds/annotations/v3/sensitive.proto index 8dc921f24b5..e2cc0b792ef 100644 --- a/xds/third_party/udpa/src/main/proto/udpa/annotations/sensitive.proto +++ b/xds/third_party/xds/src/main/proto/xds/annotations/v3/sensitive.proto @@ -1,14 +1,16 @@ syntax = "proto3"; -package udpa.annotations; +package xds.annotations.v3; import "google/protobuf/descriptor.proto"; +option go_package = "github.com/cncf/xds/go/xds/annotations/v3"; + extend google.protobuf.FieldOptions { - // Magic number is the 28 most significant bits in the sha256sum of "udpa.annotations.sensitive". + // Magic number is the 28 most significant bits in the sha256sum of "xds.annotations.v3.sensitive". // When set to true, `sensitive` indicates that this field contains sensitive data, such as // personally identifiable information, passwords, or private keys, and should be redacted for // display by tools aware of this annotation. Note that that this has no effect on standard // Protobuf functions such as `TextFormat::PrintToString`. - bool sensitive = 76569463; + bool sensitive = 61008053; } diff --git a/xds/third_party/xds/src/main/proto/xds/annotations/v3/status.proto b/xds/third_party/xds/src/main/proto/xds/annotations/v3/status.proto new file mode 100644 index 00000000000..367e784f671 --- /dev/null +++ b/xds/third_party/xds/src/main/proto/xds/annotations/v3/status.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; + +package xds.annotations.v3; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/cncf/xds/go/xds/annotations/v3"; + +// Magic number in this file derived from top 28bit of SHA256 digest of +// "xds.annotations.v3.status". +extend google.protobuf.FileOptions { + FileStatusAnnotation file_status = 226829418; +} + +extend google.protobuf.MessageOptions { + MessageStatusAnnotation message_status = 226829418; +} + +extend google.protobuf.FieldOptions { + FieldStatusAnnotation field_status = 226829418; +} + +message FileStatusAnnotation { + // The entity is work-in-progress and subject to breaking changes. + bool work_in_progress = 1; +} + +message MessageStatusAnnotation { + // The entity is work-in-progress and subject to breaking changes. + bool work_in_progress = 1; +} + +message FieldStatusAnnotation { + // The entity is work-in-progress and subject to breaking changes. + bool work_in_progress = 1; +} + +enum PackageVersionStatus { + // Unknown package version status. + UNKNOWN = 0; + + // This version of the package is frozen. + FROZEN = 1; + + // This version of the package is the active development version. + ACTIVE = 2; + + // This version of the package is the candidate for the next major version. It + // is typically machine generated from the active development version. + NEXT_MAJOR_VERSION_CANDIDATE = 3; +} + +message StatusAnnotation { + // The entity is work-in-progress and subject to breaking changes. + bool work_in_progress = 1; + + // The entity belongs to a package with the given version status. + PackageVersionStatus package_version_status = 2; +} diff --git a/xds/third_party/xds/src/main/proto/xds/annotations/v3/versioning.proto b/xds/third_party/xds/src/main/proto/xds/annotations/v3/versioning.proto new file mode 100644 index 00000000000..b6440f1949b --- /dev/null +++ b/xds/third_party/xds/src/main/proto/xds/annotations/v3/versioning.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package xds.annotations.v3; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/cncf/xds/go/xds/annotations/v3"; + +extend google.protobuf.MessageOptions { + // Magic number is the 28 most significant bits in the sha256sum of + // "xds.annotations.v3.versioning". + VersioningAnnotation versioning = 92389011; +} + +message VersioningAnnotation { + // Track the previous message type. E.g. this message might be + // xds.foo.v3alpha.Foo and it was previously xds.bar.v2.Bar. This + // information is consumed by UDPA via proto descriptors. + string previous_message_type = 1; +} diff --git a/xds/third_party/udpa/src/main/proto/xds/core/v3/authority.proto b/xds/third_party/xds/src/main/proto/xds/core/v3/authority.proto similarity index 67% rename from xds/third_party/udpa/src/main/proto/xds/core/v3/authority.proto rename to xds/third_party/xds/src/main/proto/xds/core/v3/authority.proto index 49daf4b8cb6..d666c38eafa 100644 --- a/xds/third_party/udpa/src/main/proto/xds/core/v3/authority.proto +++ b/xds/third_party/xds/src/main/proto/xds/core/v3/authority.proto @@ -2,15 +2,16 @@ syntax = "proto3"; package xds.core.v3; -import "udpa/annotations/status.proto"; +import "xds/annotations/v3/status.proto"; import "validate/validate.proto"; option java_outer_classname = "AuthorityProto"; option java_multiple_files = true; -option java_package = "com.github.udpa.xds.core.v3"; +option java_package = "com.github.xds.core.v3"; +option go_package = "github.com/cncf/xds/go/xds/core/v3"; -option (udpa.annotations.file_status).work_in_progress = true; +option (xds.annotations.v3.file_status).work_in_progress = true; // xDS authority information. message Authority { diff --git a/xds/third_party/udpa/src/main/proto/xds/core/v3/collection_entry.proto b/xds/third_party/xds/src/main/proto/xds/core/v3/collection_entry.proto similarity index 87% rename from xds/third_party/udpa/src/main/proto/xds/core/v3/collection_entry.proto rename to xds/third_party/xds/src/main/proto/xds/core/v3/collection_entry.proto index 4ece240ca3e..043a9c421f2 100644 --- a/xds/third_party/udpa/src/main/proto/xds/core/v3/collection_entry.proto +++ b/xds/third_party/xds/src/main/proto/xds/core/v3/collection_entry.proto @@ -4,16 +4,17 @@ package xds.core.v3; import "google/protobuf/any.proto"; -import "udpa/annotations/status.proto"; +import "xds/annotations/v3/status.proto"; import "xds/core/v3/resource_locator.proto"; import "validate/validate.proto"; option java_outer_classname = "CollectionEntryProto"; option java_multiple_files = true; -option java_package = "com.github.udpa.xds.core.v3"; +option java_package = "com.github.xds.core.v3"; +option go_package = "github.com/cncf/xds/go/xds/core/v3"; -option (udpa.annotations.file_status).work_in_progress = true; +option (xds.annotations.v3.file_status).work_in_progress = true; // xDS collection resource wrapper. This encapsulates a xDS resource when // appearing inside a list collection resource. List collection resources are diff --git a/xds/third_party/udpa/src/main/proto/xds/core/v3/context_params.proto b/xds/third_party/xds/src/main/proto/xds/core/v3/context_params.proto similarity index 76% rename from xds/third_party/udpa/src/main/proto/xds/core/v3/context_params.proto rename to xds/third_party/xds/src/main/proto/xds/core/v3/context_params.proto index 8f27c1ca7e5..2a0c079e5d9 100644 --- a/xds/third_party/udpa/src/main/proto/xds/core/v3/context_params.proto +++ b/xds/third_party/xds/src/main/proto/xds/core/v3/context_params.proto @@ -2,13 +2,14 @@ syntax = "proto3"; package xds.core.v3; -import "udpa/annotations/status.proto"; +import "xds/annotations/v3/status.proto"; option java_outer_classname = "ContextParamsProto"; option java_multiple_files = true; -option java_package = "com.github.udpa.xds.core.v3"; +option java_package = "com.github.xds.core.v3"; +option go_package = "github.com/cncf/xds/go/xds/core/v3"; -option (udpa.annotations.file_status).work_in_progress = true; +option (xds.annotations.v3.file_status).work_in_progress = true; // Additional parameters that can be used to select resource variants. These include any // global context parameters, per-resource type client feature capabilities and per-resource diff --git a/xds/third_party/udpa/src/main/proto/xds/core/v3/resource_locator.proto b/xds/third_party/xds/src/main/proto/xds/core/v3/resource_locator.proto similarity index 95% rename from xds/third_party/udpa/src/main/proto/xds/core/v3/resource_locator.proto rename to xds/third_party/xds/src/main/proto/xds/core/v3/resource_locator.proto index d7334394ae2..9b40d52fc43 100644 --- a/xds/third_party/udpa/src/main/proto/xds/core/v3/resource_locator.proto +++ b/xds/third_party/xds/src/main/proto/xds/core/v3/resource_locator.proto @@ -2,16 +2,17 @@ syntax = "proto3"; package xds.core.v3; -import "udpa/annotations/status.proto"; +import "xds/annotations/v3/status.proto"; import "xds/core/v3/context_params.proto"; import "validate/validate.proto"; option java_outer_classname = "ResourceLocatorProto"; option java_multiple_files = true; -option java_package = "com.github.udpa.xds.core.v3"; +option java_package = "com.github.xds.core.v3"; +option go_package = "github.com/cncf/xds/go/xds/core/v3"; -option (udpa.annotations.file_status).work_in_progress = true; +option (xds.annotations.v3.file_status).work_in_progress = true; // xDS resource locators identify a xDS resource name and instruct the // data-plane load balancer on how the resource may be located. diff --git a/xds/third_party/udpa/src/main/proto/xds/core/v3/resource_name.proto b/xds/third_party/xds/src/main/proto/xds/core/v3/resource_name.proto similarity index 86% rename from xds/third_party/udpa/src/main/proto/xds/core/v3/resource_name.proto rename to xds/third_party/xds/src/main/proto/xds/core/v3/resource_name.proto index 103c7de8640..0f3d9974079 100644 --- a/xds/third_party/udpa/src/main/proto/xds/core/v3/resource_name.proto +++ b/xds/third_party/xds/src/main/proto/xds/core/v3/resource_name.proto @@ -2,16 +2,17 @@ syntax = "proto3"; package xds.core.v3; -import "udpa/annotations/status.proto"; +import "xds/annotations/v3/status.proto"; import "xds/core/v3/context_params.proto"; import "validate/validate.proto"; option java_outer_classname = "ResourceNameProto"; option java_multiple_files = true; -option java_package = "com.github.udpa.xds.core.v3"; +option java_package = "com.github.xds.core.v3"; +option go_package = "github.com/cncf/xds/go/xds/core/v3"; -option (udpa.annotations.file_status).work_in_progress = true; +option (xds.annotations.v3.file_status).work_in_progress = true; // xDS resource name. This has a canonical xdstp:// URI representation: // diff --git a/xds/third_party/udpa/src/main/proto/udpa/data/orca/v1/orca_load_report.proto b/xds/third_party/xds/src/main/proto/xds/data/orca/v3/orca_load_report.proto similarity index 90% rename from xds/third_party/udpa/src/main/proto/udpa/data/orca/v1/orca_load_report.proto rename to xds/third_party/xds/src/main/proto/xds/data/orca/v3/orca_load_report.proto index 3105b094724..9b8f03827dc 100644 --- a/xds/third_party/udpa/src/main/proto/udpa/data/orca/v1/orca_load_report.proto +++ b/xds/third_party/xds/src/main/proto/xds/data/orca/v3/orca_load_report.proto @@ -1,10 +1,11 @@ syntax = "proto3"; -package udpa.data.orca.v1; +package xds.data.orca.v3; option java_outer_classname = "OrcaLoadReportProto"; option java_multiple_files = true; -option java_package = "com.github.udpa.udpa.data.orca.v1"; +option java_package = "com.github.xds.data.orca.v3"; +option go_package = "github.com/cncf/xds/go/xds/data/orca/v3"; import "validate/validate.proto"; diff --git a/xds/third_party/udpa/src/main/proto/udpa/service/orca/v1/orca.proto b/xds/third_party/xds/src/main/proto/xds/service/orca/v3/orca.proto similarity index 81% rename from xds/third_party/udpa/src/main/proto/udpa/service/orca/v1/orca.proto rename to xds/third_party/xds/src/main/proto/xds/service/orca/v3/orca.proto index d48cccfeacb..addf62f1ce5 100644 --- a/xds/third_party/udpa/src/main/proto/udpa/service/orca/v1/orca.proto +++ b/xds/third_party/xds/src/main/proto/xds/service/orca/v3/orca.proto @@ -1,12 +1,13 @@ syntax = "proto3"; -package udpa.service.orca.v1; +package xds.service.orca.v3; option java_outer_classname = "OrcaProto"; option java_multiple_files = true; -option java_package = "com.github.udpa.udpa.service.orca.v1"; +option java_package = "com.github.xds.service.orca.v3"; +option go_package = "github.com/cncf/xds/go/xds/service/orca/v3"; -import "udpa/data/orca/v1/orca_load_report.proto"; +import "xds/data/orca/v3/orca_load_report.proto"; import "google/protobuf/duration.proto"; @@ -24,7 +25,7 @@ import "validate/validate.proto"; // streaming service, client needs to terminate current RPC and initiate // a new call to change backend reporting frequency. service OpenRcaService { - rpc StreamCoreMetrics(OrcaLoadReportRequest) returns (stream udpa.data.orca.v1.OrcaLoadReport); + rpc StreamCoreMetrics(OrcaLoadReportRequest) returns (stream xds.data.orca.v3.OrcaLoadReport); } message OrcaLoadReportRequest { diff --git a/xds/third_party/udpa/src/main/proto/udpa/type/v1/typed_struct.proto b/xds/third_party/xds/src/main/proto/xds/type/v3/typed_struct.proto similarity index 94% rename from xds/third_party/udpa/src/main/proto/udpa/type/v1/typed_struct.proto rename to xds/third_party/xds/src/main/proto/xds/type/v3/typed_struct.proto index e46a2cb5757..5d7226c4bf6 100644 --- a/xds/third_party/udpa/src/main/proto/udpa/type/v1/typed_struct.proto +++ b/xds/third_party/xds/src/main/proto/xds/type/v3/typed_struct.proto @@ -1,10 +1,11 @@ syntax = "proto3"; -package udpa.type.v1; +package xds.type.v3; option java_outer_classname = "TypedStructProto"; option java_multiple_files = true; -option java_package = "com.github.udpa.udpa.type.v1"; +option java_package = "com.github.xds.type.v3"; +option go_package = "github.com/cncf/xds/go/xds/type/v3"; import "validate/validate.proto"; import "google/protobuf/struct.proto";