@@ -228,8 +228,8 @@ unknown field validation should be opt-in.
228
228
* kubectl should default to server-side validation against servers that support
229
229
it.
230
230
* kubectl should provide the ability for a user to request no validation,
231
- warning only validation, or client -side validation (while it is still supported)
232
- instead of strict server-side validation on a per-request basis.
231
+ or warning only validation, instead of strict server -side validation on
232
+ a per-request basis.
233
233
234
234
### Non-Goals
235
235
@@ -245,7 +245,10 @@ on version X send a request to the server of version less than X which does not
245
245
some of the fields (or a similar situation). We do not think it is worth
246
246
supporting this use case initially and will error if clients attempt to validate
247
247
schema server-side with protobuf data.
248
-
248
+ * Enhanced offline validation. Current client-side validation has been used as a
249
+ form of offline validation to simply validate configs that have no intention
250
+ of being actually applied to a server. Ideally users would have a supported
251
+ way to perform offline validation, but that is outside the scope of this KEP.
249
252
250
253
## Proposal
251
254
@@ -517,27 +520,16 @@ object has any unknown or duplicate fields.
517
520
For beta, we will modify the kubectl ` --validate ` flag from being a bool flag to
518
521
a string flag that accepts the following values:
519
522
520
- * ` server ` : This sends a request with the fieldValidation param set to ` Strict `
521
- for strict server-side validation.
522
- * ` client ` : This performs client-side validation in kubectl that breaks if it
523
- encounters any validation errors before sending a request to the server. If no
524
- client-side validation errors are found, the request sent to the server has
525
- fieldValidation param set to ` Ignore ` . This will be the default behavior in beta
526
- as it is identical to the current validation behavior pre-1.24.
527
- * ` ignore ` : This performs no client-side validation or server-side validation,
528
- sending a request to the server with fieldValidation param set to ` Ignore ` .
523
+ * ` true ` or ` strict ` : If server-side validation is enabled on the server it sends
524
+ a request with the fieldValidation param set to ` Strict ` , otherwise it falls
525
+ back to client-side validation. This is the default
526
+ * ` false ` or ` ignore ` : This performs no server-side validation or client-side validation,
527
+ sending a request to the server with fieldValidation param set to ` Ignore ` if
528
+ server-side validation is enabled.
529
529
* ` warn ` : This sends a request to the server with the fieldValidation param set
530
530
to ` Warn ` . It performs server-side validation, but validation errors are
531
531
exposed as warnings in the result header rather than failing the request. This
532
532
will be the default once server-side validation goes GA.
533
- * ` strict ` : same behavior as ` --validate=server ` . This will be the default
534
- behavior for servers with the server-side field validation feature enabled.
535
- * ` true ` : This is the same as ` --validate=strict ` for servers where server side field
536
- validation is enabled. For pre-1.24 servers and servers with the server-side
537
- field validation feature disabled, this will perform client-side validation
538
- identical to ` --validate=client ` . Passing the ` --validate ` flag
539
- without a value set behaves identical to ` --validate=true ` .
540
- * ` false ` : This is the same as ` --validate=ignore `
541
533
542
534
543
535
### Test Plan
@@ -605,7 +597,7 @@ Below are some examples to consider, in addition to the aforementioned [maturity
605
597
606
598
#### Beta
607
599
608
- - [ ] kubectl validate flag offers ability to perform server-side validation
600
+ - [ ] kubectl validate flag offers ability to perform server-side validation
609
601
- [ ] endpoints handler unit testing of field validation
610
602
- [ ] customresource handler unit testing of field validation
611
603
- [ ] field validation integration tests check for exact match of strict errors
0 commit comments