Skip to content

Commit 65babd3

Browse files
authored
format protobuf files (#3522)
1 parent 2d8537b commit 65babd3

34 files changed

+486
-512
lines changed

analysis/v1alpha1/message.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ package istio.analysis.v1alpha1;
2424

2525
import "google/protobuf/struct.proto";
2626

27-
option go_package="istio.io/api/analysis/v1alpha1";
27+
option go_package = "istio.io/api/analysis/v1alpha1";
2828

2929
// There are four messages described in this file. One of them is a struct
3030
// common to the other three: AnalysisMessageBase. Using this, we can construct
@@ -78,7 +78,6 @@ message AnalysisMessageBase {
7878
// `^http(s)?://(preliminary\.)?istio.io/docs/reference/config/analysis/`
7979
// Required.
8080
string documentation_url = 3;
81-
8281
}
8382

8483
// AnalysisMessageWeakSchema is the set of information that's needed to define a

envoy/config/filter/http/jwt_auth/v2alpha1/config.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
syntax = "proto3";
1616

17-
import "google/protobuf/duration.proto";
18-
1917
package istio.envoy.config.filter.http.jwt_auth.v2alpha1;
2018

19+
import "google/protobuf/duration.proto";
20+
2121
option go_package = "istio.io/api/envoy/config/filter/http/jwt_auth/v2alpha1";
2222

2323
// Copied from @envoy/api/envoy/api/v2/core/http_uri.proto

envoy/config/filter/network/metadata_exchange/metadata_exchange.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ syntax = "proto3";
1717

1818
package envoy.tcp.metadataexchange.config;
1919

20-
option java_outer_classname = "MetadataExchangeProto";
20+
option go_package = "istio.io/api/envoy/config/filter/network/metadata_exchange";
2121
option java_multiple_files = true;
22+
option java_outer_classname = "MetadataExchangeProto";
2223
option java_package = "io.envoyproxy.envoy.tcp.metadataexchange.config";
23-
option go_package = "istio.io/api/envoy/config/filter/network/metadata_exchange";
2424

2525
// [#protodoc-title: MetadataExchange protocol match and data transfer]
2626
// MetadataExchange protocol match and data transfer

envoy/extensions/stackdriver/config/v1alpha1/config.proto

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ syntax = "proto3";
2424

2525
package stackdriver.config.v1alpha1;
2626

27-
option go_package = "istio.io/api/envoy/extensions/stackdriver/config/v1alpha1";
28-
2927
import "google/protobuf/duration.proto";
3028
import "google/protobuf/wrappers.proto";
3129

30+
option go_package = "istio.io/api/envoy/extensions/stackdriver/config/v1alpha1";
31+
3232
// Custom instance configuration overrides.
3333
// Provides a way to customize logs.
3434
message CustomConfig {
@@ -55,11 +55,11 @@ message PluginConfig {
5555
// logs. A request is classified as error when `status>=400 or
5656
// response_flag != "-"`
5757
ERRORS_ONLY = 2;
58-
};
58+
}
5959

6060
// Optional. Controls whether to export server access log.
6161
// This is deprecated in favor of AccessLogging enum.
62-
bool disable_server_access_logging = 1 [ deprecated = true ];
62+
bool disable_server_access_logging = 1 [deprecated = true];
6363

6464
// Optional. Allows configuration of the size of the LogWrite request. The
6565
// size is in bytes, so that it allows for better performance. Default is 4MB.
@@ -84,7 +84,7 @@ message PluginConfig {
8484
// service. This is disabled by default.
8585
// Deprecated -- Mesh edge reporting is no longer supported and this setting
8686
// is no-op.
87-
bool enable_mesh_edges_reporting = 3 [ deprecated = true ];
87+
bool enable_mesh_edges_reporting = 3 [deprecated = true];
8888

8989
// Optional. Allows configuration of the time between calls out to the mesh
9090
// edges service to report *NEW* edges. The minimum configurable duration is
@@ -95,8 +95,7 @@ message PluginConfig {
9595
// reporting every `10m`.
9696
// Deprecated -- Mesh edge reporting is no longer supported and this setting
9797
// is no-op.
98-
google.protobuf.Duration mesh_edges_reporting_duration = 4
99-
[ deprecated = true ];
98+
google.protobuf.Duration mesh_edges_reporting_duration = 4 [deprecated = true];
10099

101100
// maximum size of the peer metadata cache.
102101
// A long lived proxy that connects with many transient peers can build up a
@@ -117,7 +116,7 @@ message PluginConfig {
117116
// metrics are enabled).
118117
// Deprecated -- use `metrics_overrides` instead.
119118
// if `metrics_overrides` is used, this value will be ignored.
120-
bool disable_http_size_metrics = 8 [ deprecated = true ];
119+
bool disable_http_size_metrics = 8 [deprecated = true];
121120

122121
// Optional. Allows enabling log compression for stackdriver access logs.
123122
google.protobuf.BoolValue enable_log_compression = 9;
@@ -128,18 +127,18 @@ message PluginConfig {
128127
// CEL expression for filtering access logging. If the expression evaluates
129128
// to true, an access log entry will be generated. Otherwise, no access log
130129
// entry will be generated. If there are any type errors, the CEL expression
131-
// is evaluated as false. More details on type checking can be found
130+
// is evaluated as false. More details on type checking can be found
132131
// at https://kubernetes.io/docs/reference/using-api/cel/#type-checking.
133132
// A common error is referring to a non-existent field in the log entry.
134133
// It's crucial to note that in Envoy, the fields that appear in access log
135134
// entries can vary. This variation is influenced by several factors,
136135
// including the protocol in use (such as HTTP or TCP), the applied filters,
137-
// and the specific configuration of the Envoy instance. Therefore, when
136+
// and the specific configuration of the Envoy instance. Therefore, when
138137
// using CEL expressions for filtering access logs, it's essential to ensure
139138
// that the expressions accurately refer to existing fields in the log entry.
140-
// The has() macro in CEL may be used in CEL expressions to check if a field
141-
// is accessible before attempting to access the field's value.
142-
// You can also quickly test CEL expressions at the CEL Playground
139+
// The has() macro in CEL may be used in CEL expressions to check if a field
140+
// is accessible before attempting to access the field's value.
141+
// You can also quickly test CEL expressions at the CEL Playground
143142
// at https://playcel.undistro.io/.
144143
// NOTE: Audit logs ignore configured filters.
145144
string access_logging_filter_expression = 17;

envoy/extensions/stats/config.proto

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ syntax = "proto3";
2222

2323
package stats;
2424

25-
option go_package = "istio.io/api/envoy/extensions/stats";
26-
2725
import "google/protobuf/duration.proto";
2826

27+
option go_package = "istio.io/api/envoy/extensions/stats";
28+
2929
// Metric instance configuration overrides.
3030
// The metric value and the metric type are optional and permit changing the
3131
// reported value for an existing metric.
@@ -95,14 +95,14 @@ message PluginConfig {
9595

9696
// prefix to add to stats emitted by the plugin.
9797
// DEPRECATED.
98-
string stat_prefix = 3; // default: "istio_"
98+
string stat_prefix = 3; // default: "istio_"
9999

100100
// Stats api squashes dimensions in a single string.
101101
// The squashed string is parsed at prometheus scrape time to recover
102102
// dimensions. The following 2 fields set the field and value separators {key:
103103
// value} --> key{value_separator}value{field_separator}
104-
string field_separator = 4; // default: ";;"
105-
string value_separator = 5; // default: "=="
104+
string field_separator = 4; // default: ";;"
105+
string value_separator = 5; // default: "=="
106106

107107
// Optional: Disable using host header as a fallback if destination service is
108108
// not available from the controlplane. Disable the fallback if the host

extensions/v1alpha1/wasm.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/v1alpha1/wasm.proto

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414

1515
syntax = "proto3";
1616

17-
import "google/protobuf/wrappers.proto";
18-
import "google/protobuf/struct.proto";
19-
import "type/v1beta1/selector.proto";
20-
import "google/api/field_behavior.proto";
21-
2217
// $schema: istio.extensions.v1alpha1.WasmPlugin
2318
// $title: Wasm Plugin
2419
// $description: Extend the functionality provided by the Istio proxy through WebAssembly filters.
@@ -207,7 +202,12 @@ import "google/api/field_behavior.proto";
207202
//
208203
package istio.extensions.v1alpha1;
209204

210-
option go_package="istio.io/api/extensions/v1alpha1";
205+
import "google/api/field_behavior.proto";
206+
import "google/protobuf/struct.proto";
207+
import "google/protobuf/wrappers.proto";
208+
import "type/v1beta1/selector.proto";
209+
210+
option go_package = "istio.io/api/extensions/v1alpha1";
211211

212212
// WasmPlugin provides a mechanism to extend the functionality provided by
213213
// the Istio proxy through WebAssembly filters.
@@ -389,7 +389,6 @@ message WasmPlugin {
389389
PluginType type = 14;
390390
}
391391

392-
393392
// PluginType indicates the type of Wasm extension to be used.
394393
// There are two types of extensions: `HTTP` and `NETWORK`.
395394
//
@@ -410,7 +409,7 @@ enum PluginType {
410409

411410
// Use HTTP Wasm Extension.
412411
HTTP = 1;
413-
412+
414413
// Use Network Wasm Extension.
415414
NETWORK = 2;
416415
}

gen.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ buf generate --template buf.gen-noncrd.yaml \
3636
# These plugins are sent to Envoy, which uses golang/protobuf, so do not use gogo
3737
buf generate --template buf.gen-golang.yaml \
3838
--path envoy
39+
40+
# Format Protobuf files
41+
buf format -w

mcp/v1alpha1/metadata.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package istio.mcp.v1alpha1;
2020

2121
import "google/protobuf/timestamp.proto";
2222

23-
option go_package="istio.io/api/mcp/v1alpha1";
23+
option go_package = "istio.io/api/mcp/v1alpha1";
2424

2525
// Metadata information that all resources within the Mesh Configuration Protocol must have.
2626
message Metadata {
@@ -67,9 +67,9 @@ message Metadata {
6767

6868
// Map of string keys and values that can be used to organize and categorize
6969
// resources within a collection.
70-
map<string,string> labels = 4;
70+
map<string, string> labels = 4;
7171

7272
// Map of string keys and values that can be used by source and sink to communicate
7373
// arbitrary metadata about this resource.
74-
map<string,string> annotations = 5;
74+
map<string, string> annotations = 5;
7575
}

mcp/v1alpha1/resource.proto

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ package istio.mcp.v1alpha1;
2222
import "google/protobuf/any.proto";
2323
import "mcp/v1alpha1/metadata.proto";
2424

25-
option go_package="istio.io/api/mcp/v1alpha1";
25+
option go_package = "istio.io/api/mcp/v1alpha1";
2626

2727
// Resource as transferred via the Mesh Configuration Protocol. Each
2828
// resource is made up of common metadata, and a type-specific resource payload.
2929
message Resource {
30-
// Common metadata describing the resource.
31-
istio.mcp.v1alpha1.Metadata metadata = 1;
30+
// Common metadata describing the resource.
31+
istio.mcp.v1alpha1.Metadata metadata = 1;
3232

33-
// The primary payload for the resource.
34-
google.protobuf.Any body = 2;
33+
// The primary payload for the resource.
34+
google.protobuf.Any body = 2;
3535
}

0 commit comments

Comments
 (0)