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