@@ -270,10 +270,10 @@ that server-side validation should either not be performed at all, provide
270
270
warnings for the presence of unknown/duplicate fields, or error out in the
271
271
presence of unknown/duplicate fields.
272
272
273
- For beta, we propose modifying the kubectl ` --validate ` flag to enable users
274
- to choose between client-side validation or server-side
275
- validation (either strict or warning), when server-side validation is supported
276
- by the server (and default to strict server-side validation) .
273
+ When server-side validation is enabled on the server (as will be the default
274
+ starting in beta), we propose modifying the kubectl ` --validate ` flag to
275
+ default to server-side strict validation and allow the user to choose between
276
+ strict, warn-only, or no validation.
277
277
278
278
### Notes/Constraints/Caveats (Optional)
279
279
@@ -284,12 +284,16 @@ Upon successfully providing kubectl access to server-side validation via the
284
284
` --validate ` flag, an open question will remain as to the future of client
285
285
side validation.
286
286
287
- While we would like kubectl to use server-side validation by default once it
288
- is GA, the question remains whether client-side validation be optionally
289
- available to kubectl users or completely deprecated.
287
+ Kubectl will use server-side validation by default starting in beta for servers
288
+ that have it enabled. If kubectl does not recognize a server with server-side
289
+ validation enabled, however, it will fall back to using client-side validation.
290
+ This requires maintaining client-side validation indefinitely in kubectl, which
291
+ has both pros and cons.
292
+
293
+ On the one hand, maintaining client-side validation gives users a way to
294
+ validate their objects without needing access to a server, (albeit this
295
+ mechanism is error-prone and not officially supported).
290
296
291
- Maintaining client-side validation indefinitely provides the benefit of
292
- allowing users to validate their objects without needing access to a server.
293
297
On the other hand, the downside of continuing to maintain client-side
294
298
validation is that it uses openapiv2 which will be less actively supported
295
299
as openapiv3 becomes standard and will cause client-side validation to
@@ -522,14 +526,14 @@ a string flag that accepts the following values:
522
526
523
527
* ` true ` or ` strict ` : If server-side validation is enabled on the server it sends
524
528
a request with the fieldValidation param set to ` Strict ` , otherwise it falls
525
- back to client-side validation. This is the default
529
+ back to client-side validation. The default remains ` true ` , as it currently is
530
+ today.
526
531
* ` false ` or ` ignore ` : This performs no server-side validation or client-side validation,
527
532
sending a request to the server with fieldValidation param set to ` Ignore ` if
528
533
server-side validation is enabled.
529
534
* ` warn ` : This sends a request to the server with the fieldValidation param set
530
535
to ` Warn ` . It performs server-side validation, but validation errors are
531
- exposed as warnings in the result header rather than failing the request. This
532
- will be the default once server-side validation goes GA.
536
+ exposed as warnings in the result header rather than failing the request.
533
537
534
538
535
539
### Test Plan
0 commit comments