Add maintenance_windows items schema to operatorconfiguration CRD
This commit is contained in:
parent
50d20bfd89
commit
bd24953776
1
Makefile
1
Makefile
|
|
@ -73,6 +73,7 @@ $(GENERATED_CRDS): $(GENERATED)
|
||||||
@sed -i -e 's/listKind: PostgresqlList/listKind: postgresqlList/' manifests/postgresql.crd.yaml
|
@sed -i -e 's/listKind: PostgresqlList/listKind: postgresqlList/' manifests/postgresql.crd.yaml
|
||||||
@hack/adjust_postgresql_crd.sh
|
@hack/adjust_postgresql_crd.sh
|
||||||
@mv manifests/acid.zalan.do_operatorconfigurations.yaml manifests/operatorconfiguration.crd.yaml
|
@mv manifests/acid.zalan.do_operatorconfigurations.yaml manifests/operatorconfiguration.crd.yaml
|
||||||
|
@hack/adjust_operatorconfiguration_crd.sh
|
||||||
@mv manifests/acid.zalan.do_postgresteams.yaml manifests/postgresteam.crd.yaml
|
@mv manifests/acid.zalan.do_postgresteams.yaml manifests/postgresteam.crd.yaml
|
||||||
@cp manifests/postgresql.crd.yaml pkg/apis/acid.zalan.do/v1/postgresql.crd.yaml
|
@cp manifests/postgresql.crd.yaml pkg/apis/acid.zalan.do/v1/postgresql.crd.yaml
|
||||||
@cp manifests/operatorconfiguration.crd.yaml pkg/apis/acid.zalan.do/v1/operatorconfiguration.crd.yaml
|
@cp manifests/operatorconfiguration.crd.yaml pkg/apis/acid.zalan.do/v1/operatorconfiguration.crd.yaml
|
||||||
|
|
|
||||||
|
|
@ -709,6 +709,9 @@ spec:
|
||||||
type: integer
|
type: integer
|
||||||
type: object
|
type: object
|
||||||
maintenance_windows:
|
maintenance_windows:
|
||||||
|
items:
|
||||||
|
pattern: '^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ *$'
|
||||||
|
type: string
|
||||||
type: array
|
type: array
|
||||||
major_version_upgrade:
|
major_version_upgrade:
|
||||||
description: MajorVersionUpgradeConfiguration defines how to execute
|
description: MajorVersionUpgradeConfiguration defines how to execute
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Hack to adjust the generated operatorconfiguration CRD YAML file and add
|
||||||
|
# missing field settings which can not be expressed via kubebuilder markers.
|
||||||
|
#
|
||||||
|
# Injections:
|
||||||
|
#
|
||||||
|
# * type: string and pattern for the maintenance_windows items.
|
||||||
|
# The MaintenanceWindow type marshals to/from a string (see marshal.go) but
|
||||||
|
# the field is declared `+kubebuilder:validation:Schemaless` /
|
||||||
|
# `+kubebuilder:validation:Type=array`, so controller-gen emits a bare
|
||||||
|
# `type: array` without the required `items` schema. A structural CRD must
|
||||||
|
# specify `items` for every array, so the generated CRD is rejected with:
|
||||||
|
# spec.validation.openAPIV3Schema.properties[configuration]
|
||||||
|
# .properties[maintenance_windows].items: Required value: must be specified
|
||||||
|
|
||||||
|
file="${1:-"manifests/operatorconfiguration.crd.yaml"}"
|
||||||
|
|
||||||
|
sed -i '/^[[:space:]]*maintenance_windows:$/{
|
||||||
|
# Capture the indentation
|
||||||
|
s/^\([[:space:]]*\)maintenance_windows:$/\1maintenance_windows:\n\1 items:\n\1 pattern: '\''^\\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\\d):([0-5]?\\d)|(2[0-3]|[01]?\\d):([0-5]?\\d))-((2[0-3]|[01]?\\d):([0-5]?\\d)|(2[0-3]|[01]?\\d):([0-5]?\\d))\\ *$'\''\n\1 type: string/
|
||||||
|
}' "$file"
|
||||||
|
|
@ -704,6 +704,9 @@ spec:
|
||||||
type: integer
|
type: integer
|
||||||
type: object
|
type: object
|
||||||
maintenance_windows:
|
maintenance_windows:
|
||||||
|
items:
|
||||||
|
pattern: '^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ *$'
|
||||||
|
type: string
|
||||||
type: array
|
type: array
|
||||||
major_version_upgrade:
|
major_version_upgrade:
|
||||||
description: MajorVersionUpgradeConfiguration defines how to execute
|
description: MajorVersionUpgradeConfiguration defines how to execute
|
||||||
|
|
|
||||||
|
|
@ -704,6 +704,9 @@ spec:
|
||||||
type: integer
|
type: integer
|
||||||
type: object
|
type: object
|
||||||
maintenance_windows:
|
maintenance_windows:
|
||||||
|
items:
|
||||||
|
pattern: '^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ *$'
|
||||||
|
type: string
|
||||||
type: array
|
type: array
|
||||||
major_version_upgrade:
|
major_version_upgrade:
|
||||||
description: MajorVersionUpgradeConfiguration defines how to execute
|
description: MajorVersionUpgradeConfiguration defines how to execute
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue