diff --git a/api/envoy/admin/v2alpha/metrics.proto b/api/envoy/admin/v2alpha/metrics.proto index c0b489f4e39b..9a91c7477be5 100644 --- a/api/envoy/admin/v2alpha/metrics.proto +++ b/api/envoy/admin/v2alpha/metrics.proto @@ -12,7 +12,6 @@ option java_package = "io.envoyproxy.envoy.admin.v2alpha"; message SimpleMetric { enum Type { COUNTER = 0; - GAUGE = 1; } diff --git a/api/envoy/admin/v2alpha/server_info.proto b/api/envoy/admin/v2alpha/server_info.proto index b43a6b23abd8..c2b44c06ca49 100644 --- a/api/envoy/admin/v2alpha/server_info.proto +++ b/api/envoy/admin/v2alpha/server_info.proto @@ -49,7 +49,6 @@ message ServerInfo { message CommandLineOptions { enum IpVersion { v4 = 0; - v6 = 1; } diff --git a/api/envoy/api/v2/cds.proto b/api/envoy/api/v2/cds.proto index 884e94deb0cc..bca54c91b784 100644 --- a/api/envoy/api/v2/cds.proto +++ b/api/envoy/api/v2/cds.proto @@ -138,9 +138,7 @@ message Cluster { // ignored. enum DnsLookupFamily { AUTO = 0; - V4_ONLY = 1; - V6_ONLY = 2; } @@ -185,9 +183,7 @@ message Cluster { // endpoints matching the values from the default_subset field. enum LbSubsetFallbackPolicy { NO_FALLBACK = 0; - ANY_ENDPOINT = 1; - DEFAULT_SUBSET = 2; } diff --git a/api/envoy/api/v2/core/base.proto b/api/envoy/api/v2/core/base.proto index 3388d31f4d7c..eca007605750 100644 --- a/api/envoy/api/v2/core/base.proto +++ b/api/envoy/api/v2/core/base.proto @@ -26,30 +26,20 @@ import "validate/validate.proto"; // over a single upstream connection. enum RoutingPriority { DEFAULT = 0; - HIGH = 1; } // HTTP request method. enum RequestMethod { METHOD_UNSPECIFIED = 0; - GET = 1; - HEAD = 2; - POST = 3; - PUT = 4; - DELETE = 5; - CONNECT = 6; - OPTIONS = 7; - TRACE = 8; - PATCH = 9; } diff --git a/api/envoy/api/v2/route/route.proto b/api/envoy/api/v2/route/route.proto index aafcfcb0cfac..1678c0ef9020 100644 --- a/api/envoy/api/v2/route/route.proto +++ b/api/envoy/api/v2/route/route.proto @@ -499,7 +499,6 @@ message RouteAction { // Configures :ref:`internal redirect ` behavior. enum InternalRedirectAction { PASS_THROUGH_INTERNAL_REDIRECT = 0; - HANDLE_INTERNAL_REDIRECT = 1; } diff --git a/api/envoy/config/filter/accesslog/v2/accesslog.proto b/api/envoy/config/filter/accesslog/v2/accesslog.proto index 7464094fbf2c..8810e050e95f 100644 --- a/api/envoy/config/filter/accesslog/v2/accesslog.proto +++ b/api/envoy/config/filter/accesslog/v2/accesslog.proto @@ -209,37 +209,21 @@ message ResponseFlagFilter { message GrpcStatusFilter { enum Status { OK = 0; - CANCELED = 1; - UNKNOWN = 2; - INVALID_ARGUMENT = 3; - DEADLINE_EXCEEDED = 4; - NOT_FOUND = 5; - ALREADY_EXISTS = 6; - PERMISSION_DENIED = 7; - RESOURCE_EXHAUSTED = 8; - FAILED_PRECONDITION = 9; - ABORTED = 10; - OUT_OF_RANGE = 11; - UNIMPLEMENTED = 12; - INTERNAL = 13; - UNAVAILABLE = 14; - DATA_LOSS = 15; - UNAUTHENTICATED = 16; } diff --git a/api/envoy/config/filter/http/gzip/v2/gzip.proto b/api/envoy/config/filter/http/gzip/v2/gzip.proto index ac903b693121..6b3914751be2 100644 --- a/api/envoy/config/filter/http/gzip/v2/gzip.proto +++ b/api/envoy/config/filter/http/gzip/v2/gzip.proto @@ -16,20 +16,15 @@ import "validate/validate.proto"; message Gzip { enum CompressionStrategy { DEFAULT = 0; - FILTERED = 1; - HUFFMAN = 2; - RLE = 3; } message CompressionLevel { enum Enum { DEFAULT = 0; - BEST = 1; - SPEED = 2; } } diff --git a/api/envoy/data/accesslog/v2/accesslog.proto b/api/envoy/data/accesslog/v2/accesslog.proto index 0daebb6390e7..1cb7d13112e5 100644 --- a/api/envoy/data/accesslog/v2/accesslog.proto +++ b/api/envoy/data/accesslog/v2/accesslog.proto @@ -38,11 +38,8 @@ message HTTPAccessLogEntry { // HTTP version enum HTTPVersion { PROTOCOL_UNSPECIFIED = 0; - HTTP10 = 1; - HTTP11 = 2; - HTTP2 = 3; } @@ -239,13 +236,9 @@ message ResponseFlags { message TLSProperties { enum TLSVersion { VERSION_UNSPECIFIED = 0; - TLSv1 = 1; - TLSv1_1 = 2; - TLSv1_2 = 3; - TLSv1_3 = 4; } diff --git a/api/envoy/data/core/v2alpha/health_check_event.proto b/api/envoy/data/core/v2alpha/health_check_event.proto index 454461b23ce3..29c66421e112 100644 --- a/api/envoy/data/core/v2alpha/health_check_event.proto +++ b/api/envoy/data/core/v2alpha/health_check_event.proto @@ -17,19 +17,14 @@ import "validate/validate.proto"; enum HealthCheckFailureType { ACTIVE = 0; - PASSIVE = 1; - NETWORK = 2; } enum HealthCheckerType { HTTP = 0; - TCP = 1; - GRPC = 2; - REDIS = 3; } diff --git a/tools/protoxform/protoxform.py b/tools/protoxform/protoxform.py index 25e59dd185ab..6291e311eb52 100755 --- a/tools/protoxform/protoxform.py +++ b/tools/protoxform/protoxform.py @@ -363,10 +363,13 @@ def VisitService(self, service_proto, type_context): def VisitEnum(self, enum_proto, type_context): leading_comment, trailing_comment = FormatTypeContextComments(type_context) - values = '\n'.join( + values = [ FormatEnumValue(type_context.ExtendField(index, value.name), value) - for index, value in enumerate(enum_proto.value)) - return '%senum %s {\n%s%s\n}\n' % (leading_comment, enum_proto.name, trailing_comment, values) + for index, value in enumerate(enum_proto.value) + ] + joined_values = ('\n' if any('//' in v for v in values) else '').join(values) + return '%senum %s {\n%s%s\n}\n' % (leading_comment, enum_proto.name, trailing_comment, + joined_values) def VisitMessage(self, msg_proto, type_context, nested_msgs, nested_enums): leading_comment, trailing_comment = FormatTypeContextComments(type_context)