Remove x-kubernetes-preserve-unknown-fields and XPreserveUnknownFields.

This commit is contained in:
Trung Minh Lai 2025-03-08 13:27:29 +07:00 committed by laiminhtrung1997
parent f52d9bc8fb
commit a40ba6e0de
2 changed files with 32 additions and 3 deletions

View File

@ -587,7 +587,17 @@ spec:
nullable: true nullable: true
items: items:
type: object type: object
x-kubernetes-preserve-unknown-fields: true properties:
maxSkew:
type: integer
format: int32
topologyKey:
type: string
whenUnsatisfiable:
type: string
enum:
- DoNotSchedule
- ScheduleAnyway
useLoadBalancer: useLoadBalancer:
type: boolean type: boolean
description: deprecated description: deprecated

View File

@ -111,6 +111,7 @@ var OperatorConfigCRDResourceColumns = []apiextv1.CustomResourceColumnDefinition
var min0 = 0.0 var min0 = 0.0
var min1 = 1.0 var min1 = 1.0
var minLength1 int64 = 1
var minDisable = -1.0 var minDisable = -1.0
// PostgresCRDResourceValidation to check applied manifest parameters // PostgresCRDResourceValidation to check applied manifest parameters
@ -901,7 +902,25 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
Items: &apiextv1.JSONSchemaPropsOrArray{ Items: &apiextv1.JSONSchemaPropsOrArray{
Schema: &apiextv1.JSONSchemaProps{ Schema: &apiextv1.JSONSchemaProps{
Type: "object", Type: "object",
XPreserveUnknownFields: util.True(), Properties: map[string]apiextv1.JSONSchemaProps{
"maxSkew": {
Type: "integer",
Format: "int32",
Minimum: &min1,
},
"topologyKey": {
Type: "string",
MinLength: &minLength1,
},
"whenUnsatisfiable": {
Type: "string",
Enum: []apiextv1.JSON{
{Raw: []byte(`"DoNotSchedule"`)},
{Raw: []byte(`"ScheduleAnyway"`)},
},
},
},
Required: []string{"maxSkew", "topologyKey", "whenUnsatisfiable"},
}, },
}, },
}, },