Skip to content

Commit 1620549

Browse files
authored
Add sentences to each timeout field to say '0s' disables the timeout (#3012)
* Add sentences to each timeout field to say '0s' disables the timeout * re-run codegen * update based on feedback
1 parent d298d32 commit 1620549

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

apis/v1/httproute_types.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ type HTTPRouteRule struct {
295295

296296
// HTTPRouteTimeouts defines timeouts that can be configured for an HTTPRoute.
297297
// Timeout values are represented with Gateway API Duration formatting.
298-
// Specifying a zero value such as "0s" is interpreted as no timeout.
299298
//
300299
// +kubebuilder:validation:XValidation:message="backendRequest timeout cannot be longer than request timeout",rule="!(has(self.request) && has(self.backendRequest) && duration(self.request) != duration('0s') && duration(self.backendRequest) > duration(self.request))"
301300
type HTTPRouteTimeouts struct {
@@ -307,6 +306,11 @@ type HTTPRouteTimeouts struct {
307306
// `HTTPRoute` will cause a timeout if a client request is taking longer than 10 seconds
308307
// to complete.
309308
//
309+
// Setting a timeout to the zero duration (e.g. "0s") SHOULD disable the timeout
310+
// completely. Implementations that cannot completely disable the timeout MUST
311+
// instead interpret the zero duration as the longest possible value to which
312+
// the timeout can be set.
313+
//
310314
// This timeout is intended to cover as close to the whole request-response transaction
311315
// as possible although an implementation MAY choose to start the timeout after the entire
312316
// request stream has been received instead of immediately after the transaction is
@@ -323,6 +327,11 @@ type HTTPRouteTimeouts struct {
323327
// to a backend. This covers the time from when the request first starts being
324328
// sent from the gateway to when the full response has been received from the backend.
325329
//
330+
// Setting a timeout to the zero duration (e.g. "0s") SHOULD disable the timeout
331+
// completely. Implementations that cannot completely disable the timeout MUST
332+
// instead interpret the zero duration as the longest possible value to which
333+
// the timeout can be set.
334+
//
326335
// An entire client HTTP transaction with a gateway, covered by the Request timeout,
327336
// may result in more than one call from the gateway to the destination backend,
328337
// for example, if automatic retries are supported.

config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/generated/openapi/zz_generated.openapi.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)