Skip to content

Commit d18e5fe

Browse files
committed
Explicitly state offline validation is a non-goal
1 parent d882529 commit d18e5fe

File tree

1 file changed

+13
-21
lines changed
  • keps/sig-api-machinery/2885-server-side-unknown-field-validation

1 file changed

+13
-21
lines changed

keps/sig-api-machinery/2885-server-side-unknown-field-validation/README.md

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ unknown field validation should be opt-in.
228228
* kubectl should default to server-side validation against servers that support
229229
it.
230230
* 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.
233233

234234
### Non-Goals
235235

@@ -245,7 +245,10 @@ on version X send a request to the server of version less than X which does not
245245
some of the fields (or a similar situation). We do not think it is worth
246246
supporting this use case initially and will error if clients attempt to validate
247247
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.
249252

250253
## Proposal
251254

@@ -517,27 +520,16 @@ object has any unknown or duplicate fields.
517520
For beta, we will modify the kubectl `--validate` flag from being a bool flag to
518521
a string flag that accepts the following values:
519522

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.
529529
* `warn`: This sends a request to the server with the fieldValidation param set
530530
to `Warn`. It performs server-side validation, but validation errors are
531531
exposed as warnings in the result header rather than failing the request. This
532532
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`
541533

542534

543535
### Test Plan
@@ -605,7 +597,7 @@ Below are some examples to consider, in addition to the aforementioned [maturity
605597

606598
#### Beta
607599

608-
- [ ]kubectl validate flag offers ability to perform server-side validation
600+
- [ ] kubectl validate flag offers ability to perform server-side validation
609601
- [ ] endpoints handler unit testing of field validation
610602
- [ ] customresource handler unit testing of field validation
611603
- [ ] field validation integration tests check for exact match of strict errors

0 commit comments

Comments
 (0)