You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-api-machinery/5073-declarative-validation-with-validation-gen/README.md
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -374,11 +374,11 @@ Today, the apiserver's request handler decodes incoming versioned API requests t
374
374
375
375
Assuming we use the recommended plan of declarative validation operating on versioned types, the internal type will no longer be responsible for validation.
376
376
377
-
If we were to convert from the internal back to the version of the API request for validation, we would introduce one additional conversion. If we make this an "unsafe" conversion, then it will be low cost for the vast majority of requests.
377
+
We will convert from the internal back to the version of the API request for validation introducing one additional conversion. If we make this an "unsafe" conversion, then it will be low cost for the vast majority of requests.
378
378
379
379
We will benchmark this approach and plan to use it for beta.
380
380
381
-
Long term, we could do better:
381
+
**NOTE**: Long term, it is possible that we could make one of versioned types be the hub type:
382
382
383
383
Since the internal type will no longer be used for validation, it becomes a lot less important. It is still important to have a hub type. But why not pick one of the versioned types to be the hub type? The vast majority of APIs only have one version anyway. The obvious candidate version to choose for the hub version would be the preferred storage version.
384
384
@@ -388,11 +388,17 @@ Switching to a versioned type for the hub type would have a few implications:
388
388
* We would introduce more conversion when API request version differs from the hub version. But beta APIs are off-by-default and we expect a lot less mixed version API usage than in the past.
389
389
* Would require rewriting in tree admission plugins.
390
390
391
-
This "hub version" change feels like something that could be made somewhat independent of this KEP.
391
+
This "hub version" change is something that could be made independent of this KEP, just noting the idea here.
392
+
393
+
##### Mitigation: Resolve Known "Low Hanging Fruit" of Performance Improvements In Current Validation Code
394
+
395
+
From analyzing the validation code there is "SO MUCH low-hanging fruit" - @thockin with respect to performance improvements. As such it is likely Declarative Validation can cover any perf deficit by improving validation performance generally. One example of this that already came up is related to the algorithm used for `listmap` (see prototype for more information)
392
396
393
397
##### Mitigation: Avoid Conversion to Internal Type
394
398
395
-
Requests are received as the versioned type, so it should be feasible to avoid extra conversions for resources that have no need of handwritten validations.
399
+
**NOTE** This would be a SIGNIFICANT undertaking to prove defaulting and admission is equivalent.
400
+
401
+
Requests are received as the versioned type, so it should be feasible to avoid extra conversions for resources that have no need of handwritten validations. This is likely not necessary given the known "low hanging fruit" of performance improvements but mentioned for completeness.
0 commit comments