Skip to content

Commit d463f12

Browse files
committed
Add rule to prevent users from attempting to use the ssl_groups parameter with pg17 or earlier.
1 parent 442878b commit d463f12

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18248,6 +18248,10 @@ spec:
1824818248
- instances
1824918249
- postgresVersion
1825018250
type: object
18251+
x-kubernetes-validations:
18252+
- message: The ssl_groups parameter is only available in pg18 and greater
18253+
rule: '!has(self.?config.parameters.ssl_groups) || self.postgresVersion
18254+
> 17'
1825118255
status:
1825218256
description: PostgresClusterStatus defines the observed state of PostgresCluster
1825318257
properties:

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ import (
1313
)
1414

1515
// PostgresClusterSpec defines the desired state of PostgresCluster
16+
// ---
17+
//
18+
// # Postgres 18
19+
//
20+
// +kubebuilder:validation:XValidation:rule=`!has(self.?config.parameters.ssl_groups) || self.postgresVersion > 17`,message=`The ssl_groups parameter is only available in pg18 and greater`
1621
type PostgresClusterSpec struct {
1722
// +optional
1823
Metadata *Metadata `json:"metadata,omitempty"`

0 commit comments

Comments
 (0)