Commit Graph

21 Commits

Author SHA1 Message Date
Amine 4f6b63aa11 Pre-allocate webhook accessors arrays for mutating and validating
webhooks

Kubernetes-commit: 49d03468021e24434171fde5458df34f6a753a32
2023-07-13 23:43:12 +01:00
Amine 408cf7b500 Improve naming and code comments
Kubernetes-commit: 0695853a3061ece0f602c1f267c82ced3f8c880d
2023-07-12 16:20:14 +01:00
Amine a4fba6de9b Move DeleteFunc logging to level 2
Kubernetes-commit: 28b6c90696680c87cab04b539c0bca6af7d66bac
2023-05-24 13:50:50 -05:00
Amine 83bf64e6cc Properly handle parameter in `shareInformer.DeleteFunc`
Kubernetes-commit: aeefb762ece0f866e99def259d6714aa4deb6d31
2023-05-17 18:42:56 -05:00
Amine daa816b27c Fix webhook accessors caching pattern
Kubernetes-commit: a01a8cb07e7bfe6dacadc51206ae4ef93d5f4352
2023-05-17 10:54:17 -05:00
Amine dbf21ae38a Add webhookAccessors smart reloads unit tests
This patch adds few unit tests to assert that the webhook accessors are
only recreate when they are update in the api-server.

In order to test this feature we had to make few changes to wb manager
that allows us to mock `NewValidatingWebhookAccessor` external function.

Kubernetes-commit: 7d3d44af77679ed488b28dc839d02a8258fd3adc
2023-05-12 20:32:20 -05:00
Amine c0d0aad2b4 Fix deadlock issue
This patch fixes the deadlock issue by using a map to cache already
initiated Webhooks instead of using `needRefresh` map.

Kubernetes-commit: c6f36e8702a9e90350c585298f1fc6e908699b12
2023-05-10 15:09:15 -05:00
Amine d886c0446d Webhook Accessors Smart Recompilation
Addresses https://github.com/kubernetes/kubernetes/issues/116588

This is an WIP patch trying to avoid recompiling CELs expressions when
recreation Validating/Mutating WebhookAccessors.

Maybe we should also concider using generatic.Controller from
5f59f44983/staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/controller.go

Kubernetes-commit: 99875b3fb73728caad3efb62556428b555ce02f4
2023-05-09 16:47:11 -05:00
Daniel Smith f1c42beb68 Fix N^2 startup for webhook configurations
Add a "lazy" type to track when an update is needed. It uses a nested
locking technique to avoid extra evaluation calls.

Kubernetes-commit: 5a1091d88d95bd1dd5c27f2c72cee4ecb4219dda
2023-01-09 23:29:25 +00:00
Daniel Smith d053de6ca3 Enable propagration of HasSynced
* Add tracker types and tests
* Modify ResourceEventHandler interface's OnAdd member
* Add additional ResourceEventHandlerDetailedFuncs struct
* Fix SharedInformer to let users track HasSynced for their handlers
* Fix in-tree controllers which weren't computing HasSynced correctly
* Deprecate the cache.Pop function

Kubernetes-commit: 8100efc7b3122ad119ee8fa4bbbedef3b90f2e0d
2022-11-18 00:12:50 +00:00
Abirdcfly 487ade9f5d go1.19: change some atomic.Value to atomic.Bool
Signed-off-by: Abirdcfly <fp544037857@gmail.com>

Kubernetes-commit: 1d631f7eef4db32afe23460843c4084ed3a3f6bd
2022-09-06 17:13:44 +08:00
Haowei Cai 4a7c21439a webhook config manager: HasSynced returns true when the manager is synced with existing webhookconfig objects at startup
Kubernetes-commit: 37d171e5bc6ca5b7aab7bfe52c8baabdea536415
2021-03-17 14:34:06 -07:00
Jordan Liggitt c51b9411f6 Switch admission webhook config manager to v1
Kubernetes-commit: f247e75980061d7cf83c63c0fb1f12c7060c599f
2019-08-01 21:57:39 -04:00
Joe Betz 81b56d7030 Add trace to webhook invocations
Kubernetes-commit: 31799ebe88534272d45c2a33396e343a5083c773
2019-05-31 16:50:54 -07:00
Joe Betz b22ec2bd98 Add mutating admission webhook reinvocation
Kubernetes-commit: 95fa928ecb636e8d16af31ab613678c555fc76a3
2019-05-29 22:31:26 -07:00
Joe Betz b2b1ef14ec split admissionregistration.v1beta1/Webhook into MutatingWebhook and ValidatingWebhook
Kubernetes-commit: 55ecc45455f191c404e355097bf1beae9c42f895
2019-05-29 21:30:45 -07:00
Dr. Stefan Schimanski 378bb80fc8 admission/webhook: refactor to webhook = generic-webhook + source + dispatcher
- unify test cases
- remove broken VersionedAttributes override abstraction

  This overriding had no effect. The versioned.Attributes were never
  used as admission.Attributes.Better make the versioned objects
  explicit than hiding them under a wrong abstraction.
- remove wrapping of scheme.Convert
- internalize conversion package

Kubernetes-commit: 72f8a369d021037ca6179339d50ad595b5462a6c
2018-01-16 10:37:41 +01:00
hzxuzhonghu 3dc2191ae3 add wait ready for mutating/validating webhook configuration
Kubernetes-commit: ec3925978511cc6b844c5b479c9b30ae21a0136a
2017-12-06 11:06:04 +08:00
hzxuzhonghu 3661bfee32 admission registration use shared informer instead of poll
Kubernetes-commit: f2875274423dac61293069f79eddf1c397e7376a
2017-11-29 23:12:19 +08:00
Chao Xu 98e2d6d11f remove reference to v1alpha1
Kubernetes-commit: 7945ae68d0c7cffb070d60ad4d8bfe6ef585c279
2017-11-19 13:54:50 -08:00
mbohlool 3846cb803e Rename ExternalAdmissionHookConfiguration to ValidatingWebhookConfiguration
Kubernetes-commit: 9ddea83a2ce0937cf0fc8f8c35614bb18e74cfad
2017-11-07 12:46:54 -08:00