diff --git a/manifests/postgresql.crd.yaml b/manifests/postgresql.crd.yaml index 23921934a..1a3edabfc 100644 --- a/manifests/postgresql.crd.yaml +++ b/manifests/postgresql.crd.yaml @@ -587,7 +587,17 @@ spec: nullable: true items: type: object - x-kubernetes-preserve-unknown-fields: true + properties: + maxSkew: + type: integer + format: int32 + topologyKey: + type: string + whenUnsatisfiable: + type: string + enum: + - DoNotSchedule + - ScheduleAnyway useLoadBalancer: type: boolean description: deprecated diff --git a/pkg/apis/acid.zalan.do/v1/crds.go b/pkg/apis/acid.zalan.do/v1/crds.go index 062db9ba7..b77bba1fd 100644 --- a/pkg/apis/acid.zalan.do/v1/crds.go +++ b/pkg/apis/acid.zalan.do/v1/crds.go @@ -111,6 +111,7 @@ var OperatorConfigCRDResourceColumns = []apiextv1.CustomResourceColumnDefinition var min0 = 0.0 var min1 = 1.0 +var minLength1 int64 = 1 var minDisable = -1.0 // PostgresCRDResourceValidation to check applied manifest parameters @@ -900,8 +901,26 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{ Nullable: true, Items: &apiextv1.JSONSchemaPropsOrArray{ Schema: &apiextv1.JSONSchemaProps{ - Type: "object", - XPreserveUnknownFields: util.True(), + Type: "object", + 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"}, }, }, },