Skip to content

Commit 17f615e

Browse files
authored
Merge pull request kubernetes#3319 from kevindelgado/2885-ss-field-validation-beta-1-25
Update kep for beta graduation in 1.25
2 parents 6c7accb + 5f5d3b6 commit 17f615e

File tree

2 files changed

+43
-17
lines changed

2 files changed

+43
-17
lines changed

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

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ tags, and then generate with `hack/update-toc.sh`.
9898
- [Apply Patch](#apply-patch)
9999
- [Kubectl Flag](#kubectl-flag)
100100
- [Test Plan](#test-plan)
101+
- [Unit tests](#unit-tests)
102+
- [Integration tests](#integration-tests)
103+
- [e2e tests](#e2e-tests)
101104
- [Graduation Criteria](#graduation-criteria)
102105
- [Alpha](#alpha)
103106
- [Beta](#beta)
@@ -570,17 +573,35 @@ when drafting this test plan.
570573
571574
[testing-guidelines]: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
572575
-->
573-
We can unit test and benchmark the performance of each endpoint in
574-
[apiserver/pkg/endpoints/apiserver_test.go](https://github.com/kubernetes/kubernetes/blob/dadecb2c8932fd28de9dfb94edbc7bdac7d0d28f/staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go). We will need to test that requests
575-
fail with invalid fields for all types of fields (embedding, free-form fields,
576-
etc).
576+
##### Unit tests
577+
[alpha and beta]
578+
Logic that is changed in the apiextensions schema package (i.e. objectmeta
579+
algorithm and pruning algorithm) will be thoroughly unit tested as well as
580+
changes made to the
581+
apimachinery runtime converter and json decoding.
577582

578-
Additionally, we can add integration testing for all endpoints in
579-
[test/integration/apiserver/apiserver_test.go](https://github.com/kubernetes/kubernetes/blob/master/test/integration/apiserver/apiserver_test.go)
583+
Additional testing has also been added to the
584+
[apiserver/endpoints/handlers/rest_test.go](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go) to detect unknown and duplicate fields.
580585

581-
We will also have additional testing for changes to the strategic merge patch
582-
logic in
583-
[apimachinery/pkg/util/strategicpatch/patch_test.go](https://github.com/kubernetes/kubernetes/blob/dadecb2c8932fd28de9dfb94edbc7bdac7d0d28f/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch_test.go)
586+
##### Integration tests
587+
[alpha and beta]
588+
Primarily, server side validation will be integration tested and benchmarked via a complete test
589+
suite at
590+
[test/integration/apiserver/field_validation_test.go](https://github.com/kubernetes/kubernetes/blob/master/test/integration/apiserver/field_validation_test.go)
591+
592+
It tests the cross product of all valid permutations along the dimensions of:
593+
* request type (Create vs Update vs Patch)
594+
* data format (json, yaml, json patch, json merge patch, SMP patch, apply
595+
(create), apply (update))
596+
* schema type (typed/builtin, CRD/untyped with schema, CRD/untyped without
597+
schema)
598+
599+
600+
601+
##### e2e tests
602+
[beta]
603+
With field validation on by default in beta, we will modify
604+
[test/e2e/kubectl/kubectl.go](https://github.com/kubernetes/kubernetes/blob/master/test/e2e/kubectl/kubectl.go) to ensure that kubectl defaults to using server side field validation and detects unknown/duplicate fields as expected.
584605

585606
### Graduation Criteria
586607
<!--
@@ -616,12 +637,16 @@ Below are some examples to consider, in addition to the aforementioned [maturity
616637

617638
#### Beta
618639

619-
- [ ] kubectl validate flag offers ability to perform server-side validation
620-
- [ ] endpoints handler unit testing of field validation
621-
- [ ] customresource handler unit testing of field validation
622-
- [ ] field validation integration tests check for exact match of strict errors
623-
- [ ] In tree NestedObjectDecoders no longer short circuit on strict decoding
640+
- [x] kubectl validate flag offers ability to perform server-side validation
641+
- [x] endpoints handler unit testing of field validation
642+
- [x] customresource handler unit testing of field validation
643+
- [x] field validation integration tests check for exact match of strict errors
644+
- [x] In tree NestedObjectDecoders no longer short circuit on strict decoding
624645
errors [#107545](https://github.com/kubernetes/kubernetes/issues/107545)
646+
- [ ] Unknown/Duplicate fields are properly detected in the metadata at both the
647+
root level and within embedded objects
648+
[#109215](https://github.com/kubernetes/kubernetes/issues/109215),[#109316](https://github.com/kubernetes/kubernetes/pull/109316), and
649+
[#109494](https://github.com/kubernetes/kubernetes/pull/109494)
625650

626651

627652
<!--

keps/sig-api-machinery/2885-server-side-unknown-field-validation/kep.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ reviewers:
1212
- "@smarterclayton"
1313
approvers:
1414
- "@deads2k"
15+
- "@liggitt"
1516

1617
##### WARNING !!! ######
1718
# prr-approvers has been moved to its own location
@@ -29,13 +30,13 @@ stage: beta
2930
# The most recent milestone for which work toward delivery of this KEP has been
3031
# done. This can be the current (upcoming) milestone, if it is being actively
3132
# worked on.
32-
latest-milestone: "v1.24"
33+
latest-milestone: "v1.25"
3334

3435
# The milestone at which this feature was, or is targeted to be, at each stage.
3536
milestone:
3637
alpha: "v1.23"
37-
beta: "v1.24"
38-
stable: "v1.25"
38+
beta: "v1.25"
39+
stable: "v1.26"
3940

4041
# The following PRR answers are required at alpha release
4142
# List the feature gate name and the components for which it must be enabled

0 commit comments

Comments
 (0)