preserving fields only when using k8s specs

This commit is contained in:
Felix Kunde 2020-11-23 16:06:01 +01:00
parent 580883bc59
commit d66857c164
10 changed files with 146 additions and 432 deletions

View File

@ -47,7 +47,6 @@ spec:
schema: schema:
openAPIV3Schema: openAPIV3Schema:
type: object type: object
x-preserve-unknown-fields: true
required: required:
- kind - kind
- apiVersion - apiVersion
@ -97,7 +96,7 @@ spec:
nullable: true nullable: true
items: items:
type: object type: object
additionalProperties: true x-kubernetes-preserve-unknown-fields: true
workers: workers:
type: integer type: integer
minimum: 1 minimum: 1

View File

@ -59,7 +59,6 @@ spec:
schema: schema:
openAPIV3Schema: openAPIV3Schema:
type: object type: object
x-preserve-unknown-fields: true
required: required:
- kind - kind
- apiVersion - apiVersion
@ -101,6 +100,7 @@ spec:
type: string type: string
volumeSource: volumeSource:
type: object type: object
x-kubernetes-preserve-unknown-fields: true
subPath: subPath:
type: string type: string
allowedSourceRanges: allowedSourceRanges:
@ -194,7 +194,7 @@ spec:
enableConnectionPooler: enableConnectionPooler:
type: boolean type: boolean
enableReplicaConnectionPooler: enableReplicaConnectionPooler:
type: boolean type: boolean
enableLogicalBackup: enableLogicalBackup:
type: boolean type: boolean
enableMasterLoadBalancer: enableMasterLoadBalancer:
@ -208,87 +208,43 @@ spec:
nullable: true nullable: true
items: items:
type: object type: object
required: x-kubernetes-preserve-unknown-fields: true
- cluster initContainers:
properties: type: array
cluster: nullable: true
type: string items:
s3_endpoint:
type: string
s3_access_key_id:
type: string
s3_secret_access_key:
type: string
s3_force_path_style:
type: string
s3_wal_path:
type: string
timestamp:
type: string
pattern: '^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(([Zz])|([+-]([01][0-9]|2[0-3]):[0-5][0-9]))$'
# The regexp matches the date-time format (RFC 3339 Section 5.6) that specifies a timezone as an offset relative to UTC
# Example: 1996-12-19T16:39:57-08:00
# Note: this field requires a timezone
uid:
format: uuid
type: string
databases:
type: object type: object
additionalProperties: x-kubernetes-preserve-unknown-fields: true
type: string logicalBackupSchedule:
# Note: usernames specified here as database owners must be declared in the users key of the spec key. type: string
dockerImage: pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'
maintenanceWindows:
type: array
items:
type: string type: string
enableLogicalBackup: pattern: '^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ *$'
type: boolean numberOfInstances:
enableMasterLoadBalancer: type: integer
type: boolean minimum: 0
enableReplicaLoadBalancer: patroni:
type: boolean type: object
enableShmVolume: properties:
type: boolean initdb:
init_containers: # deprecated
type: array
nullable: true
items:
type: object type: object
additionalProperties: true additionalProperties:
initContainers: type: string
type: array ttl:
nullable: true
items:
type: object
additionalProperties: true
logicalBackupSchedule:
type: string
pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'
maintenanceWindows:
type: array
items:
type: string
pattern: '^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ *$'
numberOfInstances:
type: integer type: integer
minimum: 0 loop_wait:
patroni: type: integer
type: object retry_timeout:
properties: type: integer
initdb: maximum_lag_on_failover:
type: object type: integer
additionalProperties: synchronous_mode:
type: string type: boolean
ttl: synchronous_mode_strict:
type: integer type: boolean
loop_wait:
type: integer
retry_timeout:
type: integer
maximum_lag_on_failover:
type: integer
synchronous_mode:
type: boolean
synchronous_mode_strict:
type: boolean
podAnnotations: podAnnotations:
type: object type: object
additionalProperties: additionalProperties:
@ -304,114 +260,18 @@ spec:
properties: properties:
version: version:
type: string type: string
pod_priority_class_name: # deprecated enum:
type: string - "9.3"
podPriorityClassName: - "9.4"
type: string - "9.5"
postgresql: - "9.6"
type: object - "10"
required: - "11"
- version - "12"
properties: - "13"
version: parameters:
type: string
enum:
- "9.3"
- "9.4"
- "9.5"
- "9.6"
- "10"
- "11"
- "12"
- "13"
parameters:
type: object
additionalProperties:
type: string
replicaLoadBalancer: # deprecated
type: boolean
resources:
type: object
required:
- requests
- limits
properties:
limits:
type: object
required:
- cpu
- memory
properties:
cpu:
type: string
# Decimal natural followed by m, or decimal natural followed by
# dot followed by up to three decimal digits.
#
# This is because the Kubernetes CPU resource has millis as the
# maximum precision. The actual values are checked in code
# because the regular expression would be huge and horrible and
# not very helpful in validation error messages; this one checks
# only the format of the given number.
#
# https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
pattern: '^(\d+m|\d+\.\d{1,3})$'
# Note: the value specified here must not be zero or be lower
# than the corresponding request.
memory:
type: string
# You can express memory as a plain integer or as a fixed-point
# integer using one of these suffixes: E, P, T, G, M, k. You can
# also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki
#
# https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
# Note: the value specified here must not be zero or be lower
# than the corresponding request.
requests:
type: object
required:
- cpu
- memory
properties:
cpu:
type: string
# Decimal natural followed by m, or decimal natural followed by
# dot followed by up to three decimal digits.
#
# This is because the Kubernetes CPU resource has millis as the
# maximum precision. The actual values are checked in code
# because the regular expression would be huge and horrible and
# not very helpful in validation error messages; this one checks
# only the format of the given number.
#
# https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
pattern: '^(\d+m|\d+\.\d{1,3})$'
# Note: the value specified here must not be zero or be higher
# than the corresponding limit.
memory:
type: string
# You can express memory as a plain integer or as a fixed-point
# integer using one of these suffixes: E, P, T, G, M, k. You can
# also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki
#
# https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
# Note: the value specified here must not be zero or be higher
# than the corresponding limit.
sidecars:
type: array
nullable: true
items:
type: object type: object
additionalProperties: true additionalProperties:
spiloFSGroup:
type: integer
standby:
type: object
required:
- s3_wal_path
properties:
s3_wal_path:
type: string type: string
preparedDatabases: preparedDatabases:
type: object type: object
@ -502,7 +362,7 @@ spec:
nullable: true nullable: true
items: items:
type: object type: object
additionalProperties: true x-kubernetes-preserve-unknown-fields: true
spiloRunAsUser: spiloRunAsUser:
type: integer type: integer
spiloRunAsGroup: spiloRunAsGroup:
@ -609,4 +469,4 @@ spec:
status: status:
type: object type: object
additionalProperties: additionalProperties:
type: string type: string

View File

@ -27,7 +27,6 @@ spec:
schema: schema:
openAPIV3Schema: openAPIV3Schema:
type: object type: object
x-preserve-unknown-fields: true
required: required:
- kind - kind
- apiVersion - apiVersion

2
go.mod
View File

@ -10,7 +10,7 @@ require (
github.com/sirupsen/logrus v1.7.0 github.com/sirupsen/logrus v1.7.0
github.com/stretchr/testify v1.5.1 github.com/stretchr/testify v1.5.1
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/tools v0.0.0-20201026223136-e84cfc6dd5ca // indirect golang.org/x/tools v0.0.0-20201121010211-780cb80bd7fb // indirect
gopkg.in/yaml.v2 v2.2.8 gopkg.in/yaml.v2 v2.2.8
k8s.io/api v0.19.3 k8s.io/api v0.19.3
k8s.io/apiextensions-apiserver v0.19.3 k8s.io/apiextensions-apiserver v0.19.3

4
go.sum
View File

@ -505,8 +505,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20201026223136-e84cfc6dd5ca h1:vL6Mv8VrSxz8azdgLrH/zO/Rd1Bzdk89ZfMVW39gD0Q= golang.org/x/tools v0.0.0-20201121010211-780cb80bd7fb h1:z5+u0pkAUPUWd3taoTialQ2JAMo4Wo1Z3L25U4ZV9r0=
golang.org/x/tools v0.0.0-20201026223136-e84cfc6dd5ca/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201121010211-780cb80bd7fb/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=

View File

@ -43,7 +43,6 @@ spec:
schema: schema:
openAPIV3Schema: openAPIV3Schema:
type: object type: object
x-preserve-unknown-fields: true
required: required:
- kind - kind
- apiVersion - apiVersion
@ -93,7 +92,7 @@ spec:
nullable: true nullable: true
items: items:
type: object type: object
additionalProperties: true x-kubernetes-preserve-unknown-fields: true
workers: workers:
type: integer type: integer
minimum: 1 minimum: 1

View File

@ -55,7 +55,6 @@ spec:
schema: schema:
openAPIV3Schema: openAPIV3Schema:
type: object type: object
x-preserve-unknown-fields: true
required: required:
- kind - kind
- apiVersion - apiVersion
@ -97,6 +96,7 @@ spec:
type: string type: string
volumeSource: volumeSource:
type: object type: object
x-kubernetes-preserve-unknown-fields: true
subPath: subPath:
type: string type: string
allowedSourceRanges: allowedSourceRanges:
@ -204,87 +204,43 @@ spec:
nullable: true nullable: true
items: items:
type: object type: object
required: x-kubernetes-preserve-unknown-fields: true
- cluster initContainers:
properties: type: array
cluster: nullable: true
type: string items:
s3_endpoint:
type: string
s3_access_key_id:
type: string
s3_secret_access_key:
type: string
s3_force_path_style:
type: string
s3_wal_path:
type: string
timestamp:
type: string
pattern: '^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(([Zz])|([+-]([01][0-9]|2[0-3]):[0-5][0-9]))$'
# The regexp matches the date-time format (RFC 3339 Section 5.6) that specifies a timezone as an offset relative to UTC
# Example: 1996-12-19T16:39:57-08:00
# Note: this field requires a timezone
uid:
format: uuid
type: string
databases:
type: object type: object
additionalProperties: x-kubernetes-preserve-unknown-fields: true
type: string logicalBackupSchedule:
# Note: usernames specified here as database owners must be declared in the users key of the spec key. type: string
dockerImage: pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'
maintenanceWindows:
type: array
items:
type: string type: string
enableLogicalBackup: pattern: '^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ *$'
type: boolean numberOfInstances:
enableMasterLoadBalancer: type: integer
type: boolean minimum: 0
enableReplicaLoadBalancer: patroni:
type: boolean type: object
enableShmVolume: properties:
type: boolean initdb:
init_containers: # deprecated
type: array
nullable: true
items:
type: object type: object
additionalProperties: true additionalProperties:
initContainers: type: string
type: array ttl:
nullable: true
items:
type: object
additionalProperties: true
logicalBackupSchedule:
type: string
pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'
maintenanceWindows:
type: array
items:
type: string
pattern: '^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ *$'
numberOfInstances:
type: integer type: integer
minimum: 0 loop_wait:
patroni: type: integer
type: object retry_timeout:
properties: type: integer
initdb: maximum_lag_on_failover:
type: object type: integer
additionalProperties: synchronous_mode:
type: string type: boolean
ttl: synchronous_mode_strict:
type: integer type: boolean
loop_wait:
type: integer
retry_timeout:
type: integer
maximum_lag_on_failover:
type: integer
synchronous_mode:
type: boolean
synchronous_mode_strict:
type: boolean
podAnnotations: podAnnotations:
type: object type: object
additionalProperties: additionalProperties:
@ -300,114 +256,18 @@ spec:
properties: properties:
version: version:
type: string type: string
pod_priority_class_name: # deprecated enum:
type: string - "9.3"
podPriorityClassName: - "9.4"
type: string - "9.5"
postgresql: - "9.6"
type: object - "10"
required: - "11"
- version - "12"
properties: - "13"
version: parameters:
type: string
enum:
- "9.3"
- "9.4"
- "9.5"
- "9.6"
- "10"
- "11"
- "12"
- "13"
parameters:
type: object
additionalProperties:
type: string
replicaLoadBalancer: # deprecated
type: boolean
resources:
type: object
required:
- requests
- limits
properties:
limits:
type: object
required:
- cpu
- memory
properties:
cpu:
type: string
# Decimal natural followed by m, or decimal natural followed by
# dot followed by up to three decimal digits.
#
# This is because the Kubernetes CPU resource has millis as the
# maximum precision. The actual values are checked in code
# because the regular expression would be huge and horrible and
# not very helpful in validation error messages; this one checks
# only the format of the given number.
#
# https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
pattern: '^(\d+m|\d+\.\d{1,3})$'
# Note: the value specified here must not be zero or be lower
# than the corresponding request.
memory:
type: string
# You can express memory as a plain integer or as a fixed-point
# integer using one of these suffixes: E, P, T, G, M, k. You can
# also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki
#
# https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
# Note: the value specified here must not be zero or be lower
# than the corresponding request.
requests:
type: object
required:
- cpu
- memory
properties:
cpu:
type: string
# Decimal natural followed by m, or decimal natural followed by
# dot followed by up to three decimal digits.
#
# This is because the Kubernetes CPU resource has millis as the
# maximum precision. The actual values are checked in code
# because the regular expression would be huge and horrible and
# not very helpful in validation error messages; this one checks
# only the format of the given number.
#
# https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
pattern: '^(\d+m|\d+\.\d{1,3})$'
# Note: the value specified here must not be zero or be higher
# than the corresponding limit.
memory:
type: string
# You can express memory as a plain integer or as a fixed-point
# integer using one of these suffixes: E, P, T, G, M, k. You can
# also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki
#
# https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
# Note: the value specified here must not be zero or be higher
# than the corresponding limit.
sidecars:
type: array
nullable: true
items:
type: object type: object
additionalProperties: true additionalProperties:
spiloFSGroup:
type: integer
standby:
type: object
required:
- s3_wal_path
properties:
s3_wal_path:
type: string type: string
preparedDatabases: preparedDatabases:
type: object type: object
@ -498,7 +358,7 @@ spec:
nullable: true nullable: true
items: items:
type: object type: object
additionalProperties: true x-kubernetes-preserve-unknown-fields: true
spiloRunAsUser: spiloRunAsUser:
type: integer type: integer
spiloRunAsGroup: spiloRunAsGroup:

View File

@ -23,7 +23,6 @@ spec:
schema: schema:
openAPIV3Schema: openAPIV3Schema:
type: object type: object
x-preserve-unknown-fields: true
required: required:
- kind - kind
- apiVersion - apiVersion

View File

@ -112,9 +112,8 @@ var minDisable = -1.0
// PostgresCRDResourceValidation to check applied manifest parameters // PostgresCRDResourceValidation to check applied manifest parameters
var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
OpenAPIV3Schema: &apiextv1.JSONSchemaProps{ OpenAPIV3Schema: &apiextv1.JSONSchemaProps{
Type: "object", Type: "object",
XPreserveUnknownFields: util.True(), Required: []string{"kind", "apiVersion", "spec"},
Required: []string{"kind", "apiVersion", "spec"},
Properties: map[string]apiextv1.JSONSchemaProps{ Properties: map[string]apiextv1.JSONSchemaProps{
"kind": { "kind": {
Type: "string", Type: "string",
@ -136,6 +135,38 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
Type: "object", Type: "object",
Required: []string{"numberOfInstances", "teamId", "postgresql", "volume"}, Required: []string{"numberOfInstances", "teamId", "postgresql", "volume"},
Properties: map[string]apiextv1.JSONSchemaProps{ Properties: map[string]apiextv1.JSONSchemaProps{
"additionalVolumes": {
Type: "array",
Items: &apiextv1.JSONSchemaPropsOrArray{
Schema: &apiextv1.JSONSchemaProps{
Type: "object",
Required: []string{"name", "mountPath", "volumeSource"},
Properties: map[string]apiextv1.JSONSchemaProps{
"name": {
Type: "string",
},
"mountPath": {
Type: "string",
},
"targetContainers": {
Type: "array",
Items: &apiextv1.JSONSchemaPropsOrArray{
Schema: &apiextv1.JSONSchemaProps{
Type: "string",
},
},
},
"volumeSource": {
Type: "object",
XPreserveUnknownFields: util.True(),
},
"subPath": {
Type: "string",
},
},
},
},
},
"allowedSourceRanges": { "allowedSourceRanges": {
Type: "array", Type: "array",
Nullable: true, Nullable: true,
@ -284,10 +315,8 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
Description: "Deprecated", Description: "Deprecated",
Items: &apiextv1.JSONSchemaPropsOrArray{ Items: &apiextv1.JSONSchemaPropsOrArray{
Schema: &apiextv1.JSONSchemaProps{ Schema: &apiextv1.JSONSchemaProps{
Type: "object", Type: "object",
AdditionalProperties: &apiextv1.JSONSchemaPropsOrBool{ XPreserveUnknownFields: util.True(),
Allows: true,
},
}, },
}, },
}, },
@ -295,10 +324,8 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
Type: "array", Type: "array",
Items: &apiextv1.JSONSchemaPropsOrArray{ Items: &apiextv1.JSONSchemaPropsOrArray{
Schema: &apiextv1.JSONSchemaProps{ Schema: &apiextv1.JSONSchemaProps{
Type: "object", Type: "object",
AdditionalProperties: &apiextv1.JSONSchemaPropsOrBool{ XPreserveUnknownFields: util.True(),
Allows: true,
},
}, },
}, },
}, },
@ -736,37 +763,6 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
}, },
}, },
}, },
"additionalVolumes": {
Type: "array",
Items: &apiextv1.JSONSchemaPropsOrArray{
Schema: &apiextv1.JSONSchemaProps{
Type: "object",
Required: []string{"name", "mountPath", "volumeSource"},
Properties: map[string]apiextv1.JSONSchemaProps{
"name": {
Type: "string",
},
"mountPath": {
Type: "string",
},
"targetContainers": {
Type: "array",
Items: &apiextv1.JSONSchemaPropsOrArray{
Schema: &apiextv1.JSONSchemaProps{
Type: "string",
},
},
},
"volumeSource": {
Type: "object",
},
"subPath": {
Type: "string",
},
},
},
},
},
}, },
}, },
"status": { "status": {
@ -784,9 +780,8 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
// OperatorConfigCRDResourceValidation to check applied manifest parameters // OperatorConfigCRDResourceValidation to check applied manifest parameters
var OperatorConfigCRDResourceValidation = apiextv1.CustomResourceValidation{ var OperatorConfigCRDResourceValidation = apiextv1.CustomResourceValidation{
OpenAPIV3Schema: &apiextv1.JSONSchemaProps{ OpenAPIV3Schema: &apiextv1.JSONSchemaProps{
Type: "object", Type: "object",
XPreserveUnknownFields: util.True(), Required: []string{"kind", "apiVersion", "configuration"},
Required: []string{"kind", "apiVersion", "configuration"},
Properties: map[string]apiextv1.JSONSchemaProps{ Properties: map[string]apiextv1.JSONSchemaProps{
"kind": { "kind": {
Type: "string", Type: "string",
@ -856,10 +851,8 @@ var OperatorConfigCRDResourceValidation = apiextv1.CustomResourceValidation{
Type: "array", Type: "array",
Items: &apiextv1.JSONSchemaPropsOrArray{ Items: &apiextv1.JSONSchemaPropsOrArray{
Schema: &apiextv1.JSONSchemaProps{ Schema: &apiextv1.JSONSchemaProps{
Type: "object", Type: "object",
AdditionalProperties: &apiextv1.JSONSchemaPropsOrBool{ XPreserveUnknownFields: util.True(),
Allows: true,
},
}, },
}, },
}, },

View File

@ -532,6 +532,11 @@ func (in *PostgresSpec) DeepCopyInto(out *PostgresSpec) {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
if in.EnableReplicaConnectionPooler != nil {
in, out := &in.EnableReplicaConnectionPooler, &out.EnableReplicaConnectionPooler
*out = new(bool)
**out = **in
}
if in.ConnectionPooler != nil { if in.ConnectionPooler != nil {
in, out := &in.ConnectionPooler, &out.ConnectionPooler in, out := &in.ConnectionPooler, &out.ConnectionPooler
*out = new(ConnectionPooler) *out = new(ConnectionPooler)