Skip to content

Commit adfafef

Browse files
Remove x-kubernetes-preserve-unknown-fields and XPreserveUnknownFields.
1 parent 95412eb commit adfafef

File tree

2 files changed

+100
-3
lines changed

2 files changed

+100
-3
lines changed

manifests/postgresql.crd.yaml

+36-1
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,42 @@ 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
601+
labelSelector:
602+
type: object
603+
properties:
604+
matchLabels:
605+
type: object
606+
additionalProperties:
607+
type: string
608+
matchExpressions:
609+
type: array
610+
items:
611+
type: object
612+
properties:
613+
key:
614+
type: string
615+
operator:
616+
type: string
617+
enum:
618+
- In
619+
- NotIn
620+
- Exists
621+
- DoesNotExist
622+
values:
623+
type: array
624+
items:
625+
type: string
591626
useLoadBalancer:
592627
type: boolean
593628
description: deprecated

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

+64-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,69 @@ 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+
"labelSelector": {
923+
Type: "object",
924+
Properties: map[string]apiextv1.JSONSchemaProps{
925+
"matchLabels": {
926+
Type: "object",
927+
AdditionalProperties: &apiextv1.JSONSchemaPropsOrBool{
928+
Schema: &apiextv1.JSONSchemaProps{
929+
Type: "string",
930+
},
931+
},
932+
},
933+
"matchExpressions": {
934+
Type: "array",
935+
Items: &apiextv1.JSONSchemaPropsOrArray{
936+
Schema: &apiextv1.JSONSchemaProps{
937+
Type: "object",
938+
Properties: map[string]apiextv1.JSONSchemaProps{
939+
"key": {
940+
Type: "string",
941+
},
942+
"operator": {
943+
Type: "string",
944+
Enum: []apiextv1.JSON{
945+
{Raw: []byte(`"In"`)},
946+
{Raw: []byte(`"NotIn"`)},
947+
{Raw: []byte(`"Exists"`)},
948+
{Raw: []byte(`"DoesNotExist"`)},
949+
},
950+
},
951+
"values": {
952+
Type: "array",
953+
Items: &apiextv1.JSONSchemaPropsOrArray{
954+
Schema: &apiextv1.JSONSchemaProps{
955+
Type: "string",
956+
},
957+
},
958+
},
959+
},
960+
},
961+
},
962+
},
963+
},
964+
},
965+
},
966+
Required: []string{"maxSkew", "topologyKey", "whenUnsatisfiable"},
905967
},
906968
},
907969
},

0 commit comments

Comments
 (0)