Commit Graph

11 Commits

Author SHA1 Message Date
Ondra Kupka edad3048e9 kubectl: Cache Verifier.HasSupport calls
The underlying implementation decodes OpenAPI schema on every HasSupport
call. This causes these calls to be expensive and noticable when many
resources are being applied.

This patch wraps the verifier with a thread-safe cache so that when many
resources of the same kind are being checked, only the first call
includes schema decoding.

This solution is specifically limited to the kubectl codebase without
any changes required in client-go, for now, although that is where the
issue is actually originating.

Kubernetes-commit: 9043afae6d98585dd14d203d48807b14b433d730
2025-05-23 21:58:05 +02:00
Jefftree 351ba8bb1c Lazy load OpenAPIV2
Kubernetes-commit: eb32969ab8f3d1455c33a595bba5b3ce4d8a03b8
2023-10-30 15:42:22 -04:00
Sean Sullivan 348bd97228 OpenAPIResourcesGetter allows lazy-loading OpenAPI V2
Kubernetes-commit: 6614a29f470f802915d1467f5050dbca1f8bc562
2023-03-13 20:28:40 -07:00
Alexander Zielenski a56d6d4a49 refactor factory to support fake openapiv3
Kubernetes-commit: 81dd9e3d2565f827dae34d6aac24cca690d840d1
2023-01-23 19:09:43 -08:00
Sean Sullivan ea96fe7c15 Fallback query param verifier
Kubernetes-commit: f5865043edb807f8c5efff286fe0097a382fcaf0
2023-03-07 21:50:25 +00:00
Sean Sullivan fca10494ce Refactor validation files into openapi/validation
Kubernetes-commit: 84b226409aa656fbacdcd633807dd0b04d1fb34e
2023-01-09 15:59:41 -08:00
Sean Sullivan 7c10c1c878 Unexport OpenAPIGetter factory method
Kubernetes-commit: 1da46b2f28267421dad9a8e5164e6bce16ae9fcb
2022-12-12 16:01:05 -08:00
Sean Sullivan e5c05deb7b Refactor to simplify factory Validator
Kubernetes-commit: 5e8648b9f1cdbcbb10f22fd46b6ac40dbc471de2
2022-12-11 18:20:28 -08:00
Kevin Delgado 61f42e595f add server-side validation support to kubectl
Kubernetes-commit: fe3772890f650f9bcf020b43dc5a51fab0fa17f4
2022-03-09 14:52:32 +00:00
Julian V. Modesto 04f62ffb0b Cache the OpenAPI schema for server-side dry-run.
Currently, server-side dry-run fetches the OpenAPI schema for every
single object.

This change fetches the OpenAPI schema only once.

Kubernetes-commit: caa158610dfb53de3582ed6df0eb37359206fc66
2021-01-19 16:36:14 -05:00
Sean Sullivan 1919d7fa45 Move pkg/kubectl/cmd/util and subdirs to staging
Kubernetes-commit: 6c96a059dd4a64f1917378b4a0c13899dff31918
2019-07-28 21:29:36 -07:00