Skip to content

Commit 1ea3e45

Browse files
committed
Change global validation to optional marker
1 parent 746c906 commit 1ea3e45

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

config/crd/bases/postgres-operator.crunchydata.com_postgresclusters.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14480,7 +14480,7 @@ spec:
1448014480
x-kubernetes-map-type: granular
1448114481
x-kubernetes-validations:
1448214482
- message: logfile config must end with '.log'
14483-
rule: '!has(self.logfile) || self.logfile.endsWith(''.log'')'
14483+
rule: self.?logfile.orValue("").endsWith('.log')
1448414484
users:
1448514485
additionalProperties:
1448614486
type: string
@@ -33524,7 +33524,7 @@ spec:
3352433524
x-kubernetes-map-type: granular
3352533525
x-kubernetes-validations:
3352633526
- message: logfile config must end with '.log'
33527-
rule: '!has(self.logfile) || self.logfile.endsWith(''.log'')'
33527+
rule: self.?logfile.orValue("").endsWith('.log')
3352833528
users:
3352933529
additionalProperties:
3353033530
type: string

pkg/apis/postgres-operator.crunchydata.com/v1beta1/pgbouncer_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type PGBouncerConfiguration struct {
2828
// More info: https://www.pgbouncer.org/config.html
2929
// ---
3030
// # Logging
31-
// +kubebuilder:validation:XValidation:rule=`!has(self.logfile) || self.logfile.endsWith('.log')`,message=`logfile config must end with '.log'`
31+
// +kubebuilder:validation:XValidation:rule=`self.?logfile.orValue("").endsWith('.log')`,message=`logfile config must end with '.log'`
3232
// +kubebuilder:validation:MaxProperties=50
3333
// See also XValidation rule on v1 PostgresProxySpec
3434
//

0 commit comments

Comments
 (0)