Commit Graph

205 Commits

Author SHA1 Message Date
Joe Betz 97937c66f2 Revert nested trace PR#88936
Kubernetes-commit: 02cf58102a61b6d1e021e256381ff750573ce55d
2020-07-20 09:55:05 -07:00
Joe Betz 7a467399ac Enable nested tracing, add request filter chain tracing incl. authn/authz tracing
Kubernetes-commit: b12ac0abc64adb71d97fbde12f373b1424631f20
2020-03-06 16:11:21 -08:00
Jordan Liggitt ff5372c83d Add warnings capability for admission webhooks
Kubernetes-commit: 5eef60a00aeb18eda4238dbd8f6dc96930a6a05a
2020-06-30 16:27:56 -04:00
Davanum Srinivas 5879417a28 switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 442a69c3bdf6fe8e525b05887e57d89db1e2f3a5
2020-04-17 15:25:06 -04:00
tanjunchen 529b6da9bb remove prometheus dependencies from k/k and add testcases for LabelsMatch
Kubernetes-commit: 6e986249ee4252f83037f229a8773869feaab15a
2020-04-22 14:07:53 +08:00
Rob Scott 7adab84d8a Adding IngressClass to networking/v1beta1
Co-authored-by: Christopher M. Luciano <cmluciano@us.ibm.com>

Kubernetes-commit: 132d2afca0794b4bcaedb6dbbefe4e9d66e80239
2020-02-24 21:20:45 -08:00
Jordan Liggitt 15ffd4d5c4 Remove global variable dependency from runtimeclass admission
Kubernetes-commit: 57ea7a11a646e5ad9b3f5c42ba42c0b1d279286b
2020-02-27 15:20:26 -05:00
Mike Danese 337d7943db generated: run refactor
Kubernetes-commit: 3aa59f7f3077642592dc8a864fcef8ba98699894
2020-02-07 18:16:47 -08:00
Mike Danese f7c2e26715 cleanup req.Context() and ResponseWrapper
Kubernetes-commit: 968adfa99362f733ef82f4aabb34a59dbbd6e56a
2020-01-27 18:52:27 -08:00
Mike Danese 5737088b7f refactor
Kubernetes-commit: d55d6175f8e2cfdab0b79aac72046a652c2eb515
2020-01-27 18:19:44 -08:00
Jordan Liggitt b858bded65 Promote WebhookAdmissionConfiguration to v1
Kubernetes-commit: 71fad812caf6be07be3c5eabe9fdc39c29f7b2a9
2019-11-12 09:43:35 -05:00
Jordan Liggitt 4b9c976f43 AdmissionConfiguration v1
Kubernetes-commit: 1234290adfa11eb3dd34242c296e1f1dbe211c19
2019-11-11 11:57:29 -05:00
David Eads 331894196f add featuregate inspection as admission plugin initializer
Kubernetes-commit: 675c2fb924e82091f7ce4601e48daf4cc7030e72
2019-11-05 14:28:40 -05:00
Clayton Coleman 3d42d38e70 namespace: Provide a special status cause when a namespace is terminating
Clients should be able to identify when a namespace is being terminated and
take special action such as backing off or giving up. Add a helper for
getting the cause of an error and then add a special cause to the forbidden
error that namespace lifecycle admission returns. We can't change the forbidden
reason without potentially breaking older clients and so cause is the
appropriate tool.

Add `StatusCause` and `HasStatusCause` to the errors package to make checking
for causes simpler. Add `NamespaceTerminatingCause` to the v1 API as a constant.

Kubernetes-commit: a62c5b282fda7c0832d329cde45e5e0a836924e8
2019-10-19 22:57:21 -04:00
SataQiu 630eda2c9b eliminate direct references to prometheus
Kubernetes-commit: f99b4339681329779e44cd9f0c8ffdbabfeb6fcf
2019-10-10 11:18:52 +08:00
Jordan Liggitt c51b9411f6 Switch admission webhook config manager to v1
Kubernetes-commit: f247e75980061d7cf83c63c0fb1f12c7060c599f
2019-08-01 21:57:39 -04:00
Han Kang 7400a466d2 Explicitly handle returned error values in admission metrics_test
Kubernetes-commit: 774641ebdbdc7fe89380e7e1e77f5ebbe843ecec
2019-08-21 12:13:33 -07:00
Jordan Liggitt d1d66bda16 Propagate context to Authorize() calls
Kubernetes-commit: 92eb072989eba22236d034b56cc2bf159dfb4915
2019-09-24 10:06:32 -04:00
Jordan Liggitt 25bf5d3b30 Add integration test for webhook client auth
Kubernetes-commit: e734c70e037cf1311581eb61ae3e45adaa76771b
2019-09-02 22:37:07 -04:00
Jordan Liggitt 80b9dc503b Plumb service port, URL port to webhook client auth resolution
Kubernetes-commit: d127042cb81cbf545332ec3124161525ef84183c
2019-09-02 22:38:36 -04:00
Jordan Liggitt ce4eaaeeb3 Make webhook benchmarks parallel
Kubernetes-commit: 601b7d33a9cf0b724cdabb5de81b0bf2821f0fca
2019-08-28 13:27:38 -04:00
Haowei Cai 8d86fef522 wire up the webhook rejection metrics in webhook handlers
Kubernetes-commit: 620f5f2c587971be50cb27bb2a2d35209b3dc058
2019-08-28 17:32:07 -07:00
Haowei Cai 466e192e26 test
Kubernetes-commit: 71d7477c2187c0f956b90b7b55e8beee449229a2
2019-08-28 16:54:39 -07:00
Haowei Cai c5bca07c6b add webhook rejection metrics
Kubernetes-commit: 714dced0d1c7fbb703fa55c39a071a8a97db9176
2019-08-28 16:49:47 -07:00
Haowei Cai e248b8b513 fix semantics of the rejected label in webhook metrics
when error calling webhook is ignored, do not log the request as
rejected

Kubernetes-commit: f3c793512b45ea3910d5e5a379292c13b62ab64b
2019-08-28 15:31:27 -07:00
Jordan Liggitt 58f780d1e2 Use cached selectors/client for webhooks
Kubernetes-commit: 8c10d929cac13dc50ca4ffaca83e7ae5c8e41292
2019-08-24 17:12:14 -04:00
Jordan Liggitt b7340127c3 Add admission benchmarks
go test ./vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating -bench . -benchmem -run DoNotRun
go test ./vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating -bench . -benchmem -run DoNotRun

Kubernetes-commit: 27f535e26ad88fa30d5c0fcde4bc31897b9d521c
2019-08-24 17:40:07 -04:00
Jordan Liggitt eb2a4467ba Let webhook accessors construct client/selectors once
Kubernetes-commit: 14154c2345e7e467be0ff003c61cec9c0bd2be3e
2019-08-20 17:16:21 -04:00
Han Kang b9084e350a migrate kube-apiserver metrics to stability framework
Kubernetes-commit: 466980dd747e06e55451301c624eecccfa505123
2019-08-22 15:38:42 -07:00
Haowei Cai db2bae4d84 tests
Kubernetes-commit: d35757c653893279df566985c3368f0277fe7c02
2019-05-31 16:22:55 -07:00
Haowei Cai f4a47ec53f mutating webhook: audit log mutation existence and actual patch
Kubernetes-commit: 7784353a69932a4e7b4dde55b78828abf5fa4ee6
2019-05-31 16:22:30 -07:00
Haowei Cai 70c200c6a0 audit & admission: associate annotation with audit level
Kubernetes-commit: 318226f3403f56aaf796af3f439c13674aa2b7ab
2019-05-31 15:36:29 -07:00
Jordan Liggitt 71ef46fa12 Use lesser of context or webhook-specific timeout in webhooks
Kubernetes-commit: c63284b1f3996e7830c1aca85281d349d0091c82
2019-08-19 11:23:05 -04:00
Jordan Liggitt 0c706a033c Plumb context to admission Admit/Validate
Kubernetes-commit: 61774cd7176cae0c0324d23ab20e6c6b3038153f
2019-08-19 10:48:08 -04:00
Joe Betz f103fcda51 Replace string concatination with trace fields
Kubernetes-commit: 46a04d50af78e01d06a9879d62cc71fbe892076f
2019-08-02 23:47:24 -07:00
Joe Betz 81b56d7030 Add trace to webhook invocations
Kubernetes-commit: 31799ebe88534272d45c2a33396e343a5083c773
2019-05-31 16:50:54 -07:00
Jordan Liggitt 90d670a108 AdmissionReview: Allow webhook admission to dispatch v1 or v1beta1
Kubernetes-commit: dda9bcb082be058c30c83d45e757edbaac8dc65f
2019-07-12 08:44:24 -04:00
Chao Xu 65ba1e64bc Adding test cases to make sure objectSelector works for CRD
Kubernetes-commit: 58fa71d1ed375876a86fe5961ad5a87a0eb23fa2
2019-05-31 10:12:42 -07:00
Joe Betz 3c6eb3805e Fix admission metrics to use bucket sizes matching metric unit
Kubernetes-commit: 084c52551baa3dbf0aa47f193b3abddeb8e4d673
2019-05-31 16:17:24 -07:00
Joe Betz 32d3c876b0 Flake fix: poll for webhook registration to complete in reinvocation integration tests
Kubernetes-commit: e51320f69d92e4d08bc25eec5a4b7a58d23184ab
2019-06-04 14:19:26 -07:00
Chao Xu ec622aa8bd minor changes, propagating interface changes
Kubernetes-commit: 7738c7ee8fbbaa79aed2ca221141a6b3b4f826be
2019-05-29 17:20:43 -07:00
Chao Xu 8658264258 object matcher
Kubernetes-commit: 6cf499db6c1dd464c6072706106dec6c5284dff7
2019-05-29 15:56:52 -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
Joe Betz 86ad7df5fb Add WithReinvocationTesting utility for ensuring that admission plugin reinvocation is idempotent
Kubernetes-commit: cc2e3616f03518b1fe00c51b5226010df5f17cc7
2019-05-23 22:24:20 -07:00
Jordan Liggitt 0e6c33d9b7 Consider equivalent resources when calling webhook
Kubernetes-commit: f2abdcf43f5e0435824104fe6f1af9fb3871d455
2019-05-20 14:36:19 -04:00
Jordan Liggitt d555b9c5d2 Move object conversion to webhook dispatch point
convert versionedattrs as needed

Allow per-webhook kind/version

Kubernetes-commit: fc495f457f8b7c58d062d12b03a96abd0879e4d2
2019-05-20 12:10:49 -04:00
Jordan Liggitt 6562ecd83a Add GetResourceMapper to admission ObjectInterfaces
Kubernetes-commit: 92f735042e1cae38afe74364c036489fb7a81973
2019-05-13 11:24:20 -04:00
Jordan Liggitt 054e44a286 make ObjectInterfaces impl generic
Kubernetes-commit: 9071d21e3b1989ffeee4f533406e4fef6bf32aa8
2019-05-13 11:22:11 -04:00
Jordan Liggitt afec0f3efa Skip namespace selector evaluation for 'select all' selectors
Kubernetes-commit: e068a98f4fed7ad1fa92acc00c5d3210acd29675
2019-05-20 17:45:34 -04:00