@@ -206,7 +206,7 @@ sequenceDiagram
206
206
participant C as Client
207
207
participant P as Proxy
208
208
participant U as Upstream
209
-
209
+
210
210
C->>P: Connection Started
211
211
activate U
212
212
activate C
@@ -224,7 +224,7 @@ sequenceDiagram
224
224
activate U
225
225
note left of U: timeout queue<br/>(wait for available server)
226
226
deactivate U
227
-
227
+
228
228
P->>U: Connection Started
229
229
activate U
230
230
P->>U: Starts sending Request
@@ -370,7 +370,7 @@ sequenceDiagram
370
370
371
371
Both timeout fields are string duration values as specified by
372
372
[ Golang time.ParseDuration] ( https://pkg.go.dev/time#ParseDuration ) and MUST be >= 1ms
373
- or 0 to disable (no timeout) .
373
+ and <= 100y .
374
374
375
375
### GO
376
376
@@ -388,8 +388,6 @@ type HTTPRouteRule struct {
388
388
}
389
389
390
390
// HTTPRouteTimeouts defines timeouts that can be configured for an HTTPRoute.
391
- // Timeout values are formatted like 1h/1m/1s/1ms as parsed by Golang time.ParseDuration
392
- // and MUST BE >= 1ms or 0 to disable (no timeout).
393
391
type HTTPRouteTimeouts struct {
394
392
// Request specifies the duration for processing an HTTP client request after which the
395
393
// gateway will time out if unable to send a response.
@@ -403,13 +401,22 @@ type HTTPRouteTimeouts struct {
403
401
// request stream has been received instead of immediately after the transaction is
404
402
// initiated by the client.
405
403
//
404
+ // This value follows a subset of Golang and XML Duration formatting, for example 1m, 1s,
405
+ // or 1ms. This value MUST BE >= 0 and <= 9999h. When "0" is specified, it indicates that
406
+ // no timeout should be implemented. If an implementation cannot support the granularity
407
+ // specified, it MUST round up to the closest value it supports. For example, if 1ms is
408
+ // specified, and an implementation can only configure timeouts in seconds, it MUST configure
409
+ // 1 second as the timeout. In the special case of a "0" timeout, the implementation SHOULD
410
+ // NOT implement a timeout. If that is not possible it MUST configure the maximum timeout
411
+ // value it supports.
412
+ //
406
413
// When this field is unspecified, request timeout behavior is implementation-dependent.
407
414
//
408
415
// Support: Extended
409
416
//
410
417
// +optional
411
- // +kubebuilder:validation:Format=duration
412
- Request *metav1.Duration ` json:"request,omitempty"`
418
+ // +kubebuilder:validation:Pattern=^(0|[1-9][0-9]{0,3}(m|s|ms))$
419
+ Request *metav1.Duration ` json:"request,omitempty"`
413
420
414
421
// BackendRequest specifies a timeout for an individual request from the gateway
415
422
// to a backend service. This covers the time from when the request first starts being
@@ -419,14 +426,22 @@ type HTTPRouteTimeouts struct {
419
426
// may result in more than one call from the gateway to the destination backend service,
420
427
// for example, if automatic retries are supported.
421
428
//
422
- // Because the Request timeout encompasses the BackendRequest timeout,
423
- // the value of BackendRequest defaults to and must be <= the value of Request timeout.
429
+ // This value follows a subset of Golang and XML Duration formatting, for example 1m, 1s,
430
+ // or 1ms. This value MUST BE >= 0 and <= 9999h. When "0" is specified, it indicates that
431
+ // no timeout should be implemented. If an implementation cannot support the granularity
432
+ // specified, it MUST round up to the closest value it supports. For example, if 1ms is
433
+ // specified, and an implementation can only configure timeouts in seconds, it MUST configure
434
+ // 1 second as the timeout. In the special case of a "0" timeout, the implementation SHOULD
435
+ // NOT implement a timeout. If that is not possible it MUST configure the maximum timeout
436
+ // value it supports.
437
+ //
438
+ // When this field is unspecified, request timeout behavior is implementation-dependent.
424
439
//
425
440
// Support: Extended
426
441
//
427
442
// +optional
428
- // +kubebuilder:validation:Format=duration
429
- BackendRequest *metav1. Duration ` json:"backendRequest,omitempty"`
443
+ // +kubebuilder:validation:Pattern=^(0|[1-9][0-9]{0,3}(m|s|ms))$
444
+ BackendRequest *string ` json:"backendRequest,omitempty"`
430
445
}
431
446
```
432
447
0 commit comments