Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions api/envoy/api/v2/core/health_check.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ option (gogoproto.equal_all) = true;
message HealthCheck {
// The time to wait for a health check response. If the timeout is reached the
// health check attempt will be considered a failure.
google.protobuf.Duration timeout = 1 [(validate.rules).duration.required = true];
google.protobuf.Duration timeout = 1 [
(validate.rules).duration = {required: true, gt: {}},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: IMO saying greater than 0 is a bit more clear here. Same below.

@dio dio Jun 26, 2018

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the same, but then I found that the others use gt: {} only (rather than gt: {seconds: 0}). E.g.

[(validate.rules).duration = {required: true, gt: {}}, (gogoproto.stdduration) = true];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm I still think that having the explicit value is more clear. I would rather add it here and update the other protos in a separate PR for explicitness.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattklein123 @junr03 will do. I also think that we should automatically render that requirement into doc, e.g. REQUIRED, GREATER THAN 0 SEC. But I believe that should be down in a different PR. Related: #3731

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@junr03 done in 1d2b066.

(gogoproto.stdduration) = true
];

// The interval between health checks.
google.protobuf.Duration interval = 2 [(validate.rules).duration.required = true];
google.protobuf.Duration interval = 2 [
(validate.rules).duration = {required: true, gt: {}},
(gogoproto.stdduration) = true
];

// An optional jitter amount in millseconds. If specified, during every
// internal Envoy will add 0 to interval_jitter to the wait time.
Expand Down