mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Graduate field validation to GA
This commit is contained in:
parent
f45505d19a
commit
3b6c4d307f
@ -1080,7 +1080,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
|
|||||||
|
|
||||||
genericfeatures.ServerSideApply: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.29
|
genericfeatures.ServerSideApply: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.29
|
||||||
|
|
||||||
genericfeatures.ServerSideFieldValidation: {Default: true, PreRelease: featuregate.Beta},
|
genericfeatures.ServerSideFieldValidation: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.29
|
||||||
|
|
||||||
// features that enable backwards compatibility but are scheduled to be removed
|
// features that enable backwards compatibility but are scheduled to be removed
|
||||||
// ...
|
// ...
|
||||||
|
@ -242,7 +242,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
|
|||||||
|
|
||||||
ServerSideApply: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.29
|
ServerSideApply: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.29
|
||||||
|
|
||||||
ServerSideFieldValidation: {Default: true, PreRelease: featuregate.Beta},
|
ServerSideFieldValidation: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.29
|
||||||
|
|
||||||
StorageVersionAPI: {Default: false, PreRelease: featuregate.Alpha},
|
StorageVersionAPI: {Default: false, PreRelease: featuregate.Alpha},
|
||||||
|
|
||||||
|
28
test/conformance/testdata/conformance.yaml
vendored
28
test/conformance/testdata/conformance.yaml
vendored
@ -3264,32 +3264,4 @@
|
|||||||
was configured with a subpath.
|
was configured with a subpath.
|
||||||
release: v1.12
|
release: v1.12
|
||||||
file: test/e2e/storage/subpath.go
|
file: test/e2e/storage/subpath.go
|
||||||
- testname: 'Server side field validation, typed object'
|
|
||||||
codename: '[sig-api-machinery] Field validation should detect unknown/duplicate fields [Conformance]'
|
|
||||||
description: It should reject the request if a typed object has unknown or duplicate fields.
|
|
||||||
release: v1.27
|
|
||||||
- testname: 'Server side field validation, typed unknown metadata'
|
|
||||||
codename: '[sig-api-machinery] Field validation should detect unknown metadata fields [Conformance]'
|
|
||||||
description: It should reject the request if a typed object has unknown fields in the metadata.
|
|
||||||
release: v1.27
|
|
||||||
- testname: 'Server side field validation, valid CR with validation schema'
|
|
||||||
codename: '[sig-api-machinery] Field validation should allow valid CRs for CRDs with validation schema [Conformance]'
|
|
||||||
description: When a CRD has a validation schema, it should succeed when a valid CR is applied.
|
|
||||||
release: v1.27
|
|
||||||
- testname: 'Server side field validation, unknown fields CR no validation schema'
|
|
||||||
codename: '[sig-api-machinery] Field validation should allow CRs with unknown fields for CRDs without validation schema [Conformance]'
|
|
||||||
description: When a CRD does not have a validation schema, it should succeed when a CR with unknown fields is applied.
|
|
||||||
release: v1.27
|
|
||||||
- testname: 'Server side field validation, unknown fields CR fails validation'
|
|
||||||
codename: '[sig-api-machinery] Field validation should reject CRs with unknown fields for CRDs with validation schema [Conformance]'
|
|
||||||
description: When a CRD does have a validation schema, it should reject CRs with unknown fields.
|
|
||||||
release: v1.27
|
|
||||||
- testname: 'Server side field validation, unknown metadata'
|
|
||||||
codename: '[sig-api-machinery] Field validation should reject CRs with unknown metadata [Conformance]'
|
|
||||||
description: The server should reject CRs with unknown metadata fields in both the root and embedded objects of a CR.
|
|
||||||
release: v1.27
|
|
||||||
- testname: 'Server side field validation, CR duplicates'
|
|
||||||
codename: '[sig-api-machinery] Field validation should reject CRs with duplicate fields [Conformance]'
|
|
||||||
description: The server should reject CRs with duplicate fields even when preserving unknown fields.
|
|
||||||
release: v1.27
|
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ var _ = SIGDescribe("FieldValidation", func() {
|
|||||||
Testname: Server side field validation, typed object
|
Testname: Server side field validation, typed object
|
||||||
Description: It should reject the request if a typed object has unknown or duplicate fields.
|
Description: It should reject the request if a typed object has unknown or duplicate fields.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should detect unknown and duplicate fields of a typed object", func(ctx context.Context) {
|
ginkgo.It("should detect unknown and duplicate fields of a typed object", func(ctx context.Context) {
|
||||||
ginkgo.By("apply creating a deployment")
|
ginkgo.By("apply creating a deployment")
|
||||||
invalidMetaDeployment := `{
|
invalidMetaDeployment := `{
|
||||||
"apiVersion": "apps/v1",
|
"apiVersion": "apps/v1",
|
||||||
@ -114,7 +114,7 @@ var _ = SIGDescribe("FieldValidation", func() {
|
|||||||
Testname: Server side field validation, typed unknown metadata
|
Testname: Server side field validation, typed unknown metadata
|
||||||
Description: It should reject the request if a typed object has unknown fields in the metadata.
|
Description: It should reject the request if a typed object has unknown fields in the metadata.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should detect unknown metadata fields of a typed object", func(ctx context.Context) {
|
ginkgo.It("should detect unknown metadata fields of a typed object", func(ctx context.Context) {
|
||||||
ginkgo.By("apply creating a deployment")
|
ginkgo.By("apply creating a deployment")
|
||||||
invalidMetaDeployment := `{
|
invalidMetaDeployment := `{
|
||||||
"apiVersion": "apps/v1",
|
"apiVersion": "apps/v1",
|
||||||
@ -165,7 +165,7 @@ var _ = SIGDescribe("FieldValidation", func() {
|
|||||||
Testname: Server side field validation, valid CR with validation schema
|
Testname: Server side field validation, valid CR with validation schema
|
||||||
Description: When a CRD has a validation schema, it should succeed when a valid CR is applied.
|
Description: When a CRD has a validation schema, it should succeed when a valid CR is applied.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should create/apply a valid CR for CRD with validation schema", func(ctx context.Context) {
|
ginkgo.It("should create/apply a valid CR for CRD with validation schema", func(ctx context.Context) {
|
||||||
config, err := framework.LoadConfig()
|
config, err := framework.LoadConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
framework.Failf("%s", err)
|
framework.Failf("%s", err)
|
||||||
@ -283,7 +283,7 @@ spec:
|
|||||||
Testname: Server side field validation, unknown fields CR no validation schema
|
Testname: Server side field validation, unknown fields CR no validation schema
|
||||||
Description: When a CRD does not have a validation schema, it should succeed when a CR with unknown fields is applied.
|
Description: When a CRD does not have a validation schema, it should succeed when a CR with unknown fields is applied.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should create/apply a CR with unknown fields for CRD with no validation schema", func(ctx context.Context) {
|
ginkgo.It("should create/apply a CR with unknown fields for CRD with no validation schema", func(ctx context.Context) {
|
||||||
config, err := framework.LoadConfig()
|
config, err := framework.LoadConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
framework.Failf("%s", err)
|
framework.Failf("%s", err)
|
||||||
@ -341,7 +341,7 @@ spec:
|
|||||||
Testname: Server side field validation, unknown fields CR fails validation
|
Testname: Server side field validation, unknown fields CR fails validation
|
||||||
Description: When a CRD does have a validation schema, it should reject CRs with unknown fields.
|
Description: When a CRD does have a validation schema, it should reject CRs with unknown fields.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should create/apply an invalid CR with extra properties for CRD with validation schema", func(ctx context.Context) {
|
ginkgo.It("should create/apply an invalid CR with extra properties for CRD with validation schema", func(ctx context.Context) {
|
||||||
config, err := framework.LoadConfig()
|
config, err := framework.LoadConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
framework.Failf("%s", err)
|
framework.Failf("%s", err)
|
||||||
@ -462,7 +462,7 @@ spec:
|
|||||||
Description: The server should reject CRs with unknown metadata fields in both the root and embedded objects
|
Description: The server should reject CRs with unknown metadata fields in both the root and embedded objects
|
||||||
of a CR.
|
of a CR.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should detect unknown metadata fields in both the root and embedded object of a CR", func(ctx context.Context) {
|
ginkgo.It("should detect unknown metadata fields in both the root and embedded object of a CR", func(ctx context.Context) {
|
||||||
config, err := framework.LoadConfig()
|
config, err := framework.LoadConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
framework.Failf("%s", err)
|
framework.Failf("%s", err)
|
||||||
@ -607,7 +607,7 @@ spec:
|
|||||||
Testname: Server side field validation, CR duplicates
|
Testname: Server side field validation, CR duplicates
|
||||||
Description: The server should reject CRs with duplicate fields even when preserving unknown fields.
|
Description: The server should reject CRs with duplicate fields even when preserving unknown fields.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should detect duplicates in a CR when preserving unknown fields", func(ctx context.Context) {
|
ginkgo.It("should detect duplicates in a CR when preserving unknown fields", func(ctx context.Context) {
|
||||||
config, err := framework.LoadConfig()
|
config, err := framework.LoadConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
framework.Failf("%s", err)
|
framework.Failf("%s", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user