@@ -243,7 +243,7 @@ var _ = SIGDescribe("AdmissionWebhook", func() {
243
243
testSlowWebhookTimeoutNoError (f )
244
244
slowWebhookCleanup ()
245
245
246
- ginkgo .By ("Having no error when timeout is empty (defaulted to 10s in v1beta1 )" )
246
+ ginkgo .By ("Having no error when timeout is empty (defaulted to 10s in v1 )" )
247
247
slowWebhookCleanup = registerSlowWebhook (f , f .UniqueName , context , & policyFail , nil )
248
248
testSlowWebhookTimeoutNoError (f )
249
249
slowWebhookCleanup ()
@@ -1969,9 +1969,12 @@ func testSlowWebhookTimeoutFailEarly(f *framework.Framework) {
1969
1969
name := "e2e-test-slow-webhook-configmap"
1970
1970
_ , err := client .CoreV1 ().ConfigMaps (f .Namespace .Name ).Create (& v1.ConfigMap {ObjectMeta : metav1.ObjectMeta {Name : name }})
1971
1971
framework .ExpectError (err , "create configmap in namespace %s should have timed-out reaching slow webhook" , f .Namespace .Name )
1972
- expectedErrMsg := `/always-allow-delay-5s?timeout=1s: context deadline exceeded`
1973
- if ! strings .Contains (err .Error (), expectedErrMsg ) {
1974
- e2elog .Failf ("expect error contains %q, got %q" , expectedErrMsg , err .Error ())
1972
+ // http timeout message: context deadline exceeded
1973
+ // dial timeout message: dial tcp {address}: i/o timeout
1974
+ isTimeoutError := strings .Contains (err .Error (), `context deadline exceeded` ) || strings .Contains (err .Error (), `timeout` )
1975
+ isErrorQueryingWebhook := strings .Contains (err .Error (), `/always-allow-delay-5s?timeout=1s` )
1976
+ if ! isTimeoutError || ! isErrorQueryingWebhook {
1977
+ e2elog .Failf ("expect an HTTP/dial timeout error querying the slow webhook, got: %q" , err .Error ())
1975
1978
}
1976
1979
}
1977
1980
0 commit comments