mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-25 20:29:56 +00:00
plumb context with request deadline
- as soon as a request is received by the apiserver, determine the timeout of the request and set a new request context with the deadline. - the timeout filter that times out non-long-running requests should use the request context as opposed to a fixed 60s wait today. - admission and storage layer uses the same request context with the deadline specified.
This commit is contained in:
@@ -124,7 +124,7 @@ func testWebhookTimeout(t *testing.T, watchCache bool) {
|
||||
},
|
||||
{
|
||||
name: "timed out client requests skip later mutating webhooks (regardless of failure policy) and fail",
|
||||
timeoutSeconds: 3,
|
||||
timeoutSeconds: 4,
|
||||
mutatingWebhooks: []testWebhook{
|
||||
{path: "/mutating/1/5s", policy: admissionv1beta1.Ignore, timeoutSeconds: 4},
|
||||
{path: "/mutating/2/1s", policy: admissionv1beta1.Ignore, timeoutSeconds: 5},
|
||||
@@ -133,8 +133,7 @@ func testWebhookTimeout(t *testing.T, watchCache bool) {
|
||||
expectInvocations: []invocation{
|
||||
{path: "/mutating/1/5s", timeoutSeconds: 3}, // from request
|
||||
},
|
||||
expectError: true,
|
||||
errorContains: "request did not complete within requested timeout",
|
||||
expectError: true,
|
||||
},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user