Skip to content

Commit dbb6aaa

Browse files
Remove x-kubernetes-preserve-unknown-fields and XPreserveUnknownFields.
1 parent 2ba8cb2 commit dbb6aaa

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

manifests/postgresql.crd.yaml

+11-1
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,17 @@ spec:
587587
nullable: true
588588
items:
589589
type: object
590-
x-kubernetes-preserve-unknown-fields: true
590+
properties:
591+
maxSkew:
592+
type: integer
593+
format: int32
594+
topologyKey:
595+
type: string
596+
whenUnsatisfiable:
597+
type: string
598+
enum:
599+
- DoNotSchedule
600+
- ScheduleAnyway
591601
useLoadBalancer:
592602
type: boolean
593603
description: deprecated

pkg/apis/acid.zalan.do/v1/crds.go

+21-2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ var OperatorConfigCRDResourceColumns = []apiextv1.CustomResourceColumnDefinition
111111

112112
var min0 = 0.0
113113
var min1 = 1.0
114+
var minLength1 int64 = 1
114115
var minDisable = -1.0
115116

116117
// PostgresCRDResourceValidation to check applied manifest parameters
@@ -900,8 +901,26 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
900901
Nullable: true,
901902
Items: &apiextv1.JSONSchemaPropsOrArray{
902903
Schema: &apiextv1.JSONSchemaProps{
903-
Type: "object",
904-
XPreserveUnknownFields: util.True(),
904+
Type: "object",
905+
Properties: map[string]apiextv1.JSONSchemaProps{
906+
"maxSkew": {
907+
Type: "integer",
908+
Format: "int32",
909+
Minimum: &min1,
910+
},
911+
"topologyKey": {
912+
Type: "string",
913+
MinLength: &minLength1,
914+
},
915+
"whenUnsatisfiable": {
916+
Type: "string",
917+
Enum: []apiextv1.JSON{
918+
{Raw: []byte(`"DoNotSchedule"`)},
919+
{Raw: []byte(`"ScheduleAnyway"`)},
920+
},
921+
},
922+
},
923+
Required: []string{"maxSkew", "topologyKey", "whenUnsatisfiable"},
905924
},
906925
},
907926
},

0 commit comments

Comments
 (0)