Skip to content

Commit

Permalink
chore(kuma-cp) annotate required fields in protos (#2556)
Browse files Browse the repository at this point in the history
* chore(kuma-cp) annotate required fields in protos

These fields will be used to mark fields as required in our docs
when generated

Signed-off-by: Bart Smykla <bartek@smykla.com>
  • Loading branch information
bartsmykla authored Aug 24, 2021
1 parent cf25552 commit 58b822f
Show file tree
Hide file tree
Showing 25 changed files with 1,047 additions and 998 deletions.
245 changes: 123 additions & 122 deletions api/mesh/v1alpha1/circuit_breaker.pb.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions api/mesh/v1alpha1/circuit_breaker.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ message CircuitBreaker {
option (kuma.mesh.resource).ws.name = "circuit-breaker";

// List of selectors to match dataplanes that are sources of traffic.
repeated Selector sources = 1;
repeated Selector sources = 1 [ (doc.required) = true ];

// List of selectors to match services that are destinations of traffic.
repeated Selector destinations = 2;
repeated Selector destinations = 2 [ (doc.required) = true ];

message Conf {
// Time interval between ejection analysis sweeps
Expand Down Expand Up @@ -102,5 +102,5 @@ message CircuitBreaker {
Thresholds thresholds = 6;
}

Conf conf = 3;
Conf conf = 3 [ (doc.required) = true ];
}
23 changes: 12 additions & 11 deletions api/mesh/v1alpha1/externalservice.pb.go

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

7 changes: 4 additions & 3 deletions api/mesh/v1alpha1/externalservice.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ message ExternalService {
// Networking describes the properties of the external service connectivity
message Networking {
// Address of the external service
string address = 1;
string address = 1 [ (doc.required) = true ];

// TLS
message TLS {
Expand Down Expand Up @@ -59,9 +59,10 @@ message ExternalService {
TLS tls = 2;
}

Networking networking = 1;
Networking networking = 1 [ (doc.required) = true ];

// Tags associated with the external service,
// e.g. kuma.io/service=web, kuma.io/protocol, version=1.0.
map<string, string> tags = 2 [ (validate.rules).map.min_pairs = 1 ];
map<string, string> tags = 2
[ (validate.rules).map.min_pairs = 1, (doc.required) = true ];
}
127 changes: 65 additions & 62 deletions api/mesh/v1alpha1/fault_injection.pb.go

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

18 changes: 9 additions & 9 deletions api/mesh/v1alpha1/fault_injection.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ message FaultInjection {
option (kuma.mesh.resource).ws.name = "fault-injection";

// List of selectors to match dataplanes that are sources of traffic.
repeated Selector sources = 1;
repeated Selector sources = 1 [ (doc.required) = true ];

// List of selectors to match services that are destinations of traffic.
repeated Selector destinations = 2;
repeated Selector destinations = 2 [ (doc.required) = true ];

// Conf defines several types of faults, at least one fault should be
// specified
Expand All @@ -39,9 +39,9 @@ message FaultInjection {
message Delay {
// Percentage of requests on which delay will be injected, has to be in
// [0.0 - 100.0] range
google.protobuf.DoubleValue percentage = 1;
google.protobuf.DoubleValue percentage = 1 [ (doc.required) = true ];
// The duration during which the response will be delayed
google.protobuf.Duration value = 2;
google.protobuf.Duration value = 2 [ (doc.required) = true ];
}
// Delay if specified then response from the destination will be delivered
// with a delay
Expand All @@ -53,9 +53,9 @@ message FaultInjection {
message Abort {
// Percentage of requests on which abort will be injected, has to be in
// [0.0 - 100.0] range
google.protobuf.DoubleValue percentage = 1;
google.protobuf.DoubleValue percentage = 1 [ (doc.required) = true ];
// HTTP status code which will be returned to source side
google.protobuf.UInt32Value httpStatus = 2;
google.protobuf.UInt32Value httpStatus = 2 [ (doc.required) = true ];
}
// Abort if specified makes source side to receive specified httpStatus code
Abort abort = 2;
Expand All @@ -65,15 +65,15 @@ message FaultInjection {
message ResponseBandwidth {
// Percentage of requests on which response bandwidth limit will be
// injected, has to be in [0.0 - 100.0] range
google.protobuf.DoubleValue percentage = 1;
google.protobuf.DoubleValue percentage = 1 [ (doc.required) = true ];
// Limit is represented by value measure in gbps, mbps, kbps or bps, e.g.
// 10kbps
google.protobuf.StringValue limit = 2;
google.protobuf.StringValue limit = 2 [ (doc.required) = true ];
}
// ResponseBandwidth if specified limits the speed of sending response body
ResponseBandwidth response_bandwidth = 3;
}

// Configuration of FaultInjection
Conf conf = 3;
Conf conf = 3 [ (doc.required) = true ];
}
Loading

0 comments on commit 58b822f

Please sign in to comment.