Commit Graph

72 Commits

Author SHA1 Message Date
Jordan Liggitt
afd92b3b3e Revert "plumb context with request deadline"
This reverts commit 83f869ee13.
2020-11-19 18:15:04 -05:00
Haowei Cai
40a65577c7 generated 2020-11-18 12:48:26 -08:00
Haowei Cai
8bcf34a203 unit and integration tests
apiserver dedups and adds warning in CREATE/UPDATE/PATCH requests;
also handles duplication caused by mutating admission.
2020-11-18 12:46:20 -08:00
Abu Kashem
83f869ee13
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.
2020-11-14 11:54:17 -05:00
Kubernetes Prow Robot
5549a0d9bb
Merge pull request #95012 from nodo/add-namespace-to-post-based-namespace-creation
Make the creation of namespace using POST and PATCH consistent
2020-10-01 17:37:20 -07:00
Andrea Nodari
3cb510e33e Make the creation of namespace using POST and PATCH consistent
PATCH verb is used when creating a namespace using server-side apply,
while POST verb is used when creating a namespace using client-side
apply.

The difference in path between the two ways to create a namespace led to
an inconsistency when calling webhooks. When server-side apply is used,
the request sent to webhooks has the field "namespace" populated with
the name of namespace being created. On the other hand, when using
client-side apply the "namespace" field is omitted.

This commit aims to make the behaviour consistent and populates the
"namespace" field when creating a namespace using POST verb (i.e.
client-side apply).
2020-10-01 18:05:49 +02:00
Lee Verberne
bf0a33d1de Use EphemeralContainers for storage validation
When updating ephemeral containers, convert Pod to EphemeralContainers
in storage validation. This resolves a bug where admission webhook
validation fails for ephemeral container updates because the webhook
client cannot perform the conversion.

Also enable the EphemeralContainers feature gate for the admission
control integration test, which would have caught this bug.
2020-09-10 17:24:52 +02:00
Kubernetes Prow Robot
c143ea4bbf
Merge pull request #90522 from beautytiger/fix/nilranger
cleanup: no need nil check before range
2020-08-27 17:54:31 -07:00
Jordan Liggitt
dcc536097a Deflake timeout admission test 2020-07-07 13:36:07 -04:00
Jordan Liggitt
5eef60a00a Add warnings capability for admission webhooks 2020-07-01 12:14:06 -04:00
Guangming Wang
e92a91eb72 cleanup: no need nil check before range 2020-04-27 22:12:12 +08:00
Jordan Liggitt
b7c2faf26c client-go dynamic client: add context to callers 2020-03-06 10:56:23 -05:00
Jordan Liggitt
b19dc3a474 client-go dynamic client: update DeleteOptions callers 2020-03-06 10:21:23 -05:00
Mike Danese
76f8594378 more artisanal fixes
Most of these could have been refactored automatically but it wouldn't
have been uglier. The unsophisticated tooling left lots of unnecessary
struct -> pointer -> struct transitions.
2020-03-05 14:59:47 -08:00
Mike Danese
c58e69ec79 automated refactor 2020-03-05 14:59:46 -08:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Mike Danese
d55d6175f8 refactor 2020-01-29 08:50:45 -08:00
danielqsj
6596a14d39 add missing alias of api errors under test 2019-12-26 17:29:38 +08:00
Jordan Liggitt
18ba6f9482 Remove references to unserved types 2019-12-13 12:21:33 -05:00
tanjunchen
06c5901769 fix staticcheck in test/integration/apiserver 2019-12-06 23:05:20 +08:00
Jordan Liggitt
d620493b74 Ensure webhook backend requests are not artificially rate-limited 2019-12-02 12:01:51 -05:00
Rob Scott
0fa9981e01
Splitting IP address type into IPv4 and IPv6 for EndpointSlices 2019-11-12 09:03:53 -08:00
Joe Betz
2c8ffc329b Fix reinvokation test flake by isolating webhooks and markers 2019-09-17 15:30:37 -07:00
Ted Yu
5e5824f9c5 Check the length of recorder.invocations 2019-09-15 16:43:12 -07:00
Jordan Liggitt
510140ee27 Avoid encoding from competing goroutines 2019-09-09 12:03:38 -04:00
Jordan Liggitt
e734c70e03 Add integration test for webhook client auth 2019-09-03 13:58:54 -04:00
Kubernetes Prow Robot
81f997b3c8
Merge pull request #82129 from liggitt/webhook-timeout-flake
Fix out of bounds error in timeout tests
2019-08-30 09:40:35 -07:00
Kubernetes Prow Robot
f442b6ef32
Merge pull request #82090 from liggitt/webhook-http2
Use http/1.1 for apiserver->webhook clients
2019-08-30 06:26:54 -07:00
Jordan Liggitt
b451b86131 Fix out of bounds error in timeout tests 2019-08-29 10:33:20 -04:00
Jordan Liggitt
ddc697866a Use http/1.1 in apiserver->webhook clients 2019-08-28 16:51:57 -04:00
Rob Scott
f80cee9280
Adding discovery/v1alpha1 API for EndpointSlices 2019-08-26 14:50:00 -07:00
Kubernetes Prow Robot
e2f57be0c0
Merge pull request #77824 from roycaihw/webhook-trace
mutating webhook: audit log mutation existence and patch
2019-08-23 22:26:24 -07:00
Haowei Cai
98ad20cc8f generated 2019-08-23 11:08:54 -07:00
Haowei Cai
d35757c653 tests 2019-08-23 11:08:54 -07:00
Di Xu
2771503626 drop unused check 2019-08-22 11:46:12 +08:00
Jordan Liggitt
c63284b1f3 Use lesser of context or webhook-specific timeout in webhooks 2019-08-20 22:20:19 -04:00
Kubernetes Prow Robot
44c0f64411
Merge pull request #80801 from SataQiu/fix-cert-length
Follow up #80734: update RSA keys to 2048 bits
2019-08-14 21:44:44 -07:00
Jordan Liggitt
38ec458703 Test webhooks with and without watch cache enabled 2019-08-07 00:45:25 -04:00
Jordan Liggitt
308c23cf89 Generated 2019-08-01 17:17:42 -04:00
Jordan Liggitt
dda9bcb082 AdmissionReview: Allow webhook admission to dispatch v1 or v1beta1 2019-08-01 17:17:42 -04:00
SataQiu
b5d5e7a9b4 update RSA keys to 2048 bits 2019-07-31 17:48:35 +08:00
Jordan Liggitt
e24377f190 Install/register v1 admission registration types 2019-07-08 09:49:29 -04:00
Joe Betz
e51320f69d Flake fix: poll for webhook registration to complete in reinvocation integration tests 2019-06-04 15:52:55 -07:00
Chao Xu
6cf499db6c object matcher 2019-05-30 17:23:35 -07:00
Joe Betz
95fa928ecb Add mutating admission webhook reinvocation 2019-05-30 14:31:09 -07:00
Joe Betz
55ecc45455 split admissionregistration.v1beta1/Webhook into MutatingWebhook and ValidatingWebhook 2019-05-30 14:31:09 -07:00
Jordan Liggitt
8c194ea615 Add webhook admission conversion test 2019-05-28 14:30:20 -04:00
Jordan Liggitt
0b88095a17 Switch admission webhook test to work with shared etcd 2019-05-17 09:54:14 -07:00
Chao Xu
7bb4a3bace Run deleteValidation at the storage layer so that it will be retried on
conflict.

Adding unit test verify that deleteValidation is retried.

adding e2e test verifying the webhook can intercept configmap and custom
resource deletion, and the existing object is sent via the
admissionreview.OldObject.

update the admission integration test to verify that the existing object
is passed to the deletion admission webhook as oldObject, in case of an
immediate deletion and in case of an update-on-delete.
2019-05-17 09:54:11 -07:00