You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/v4/postgrescluster_types.go
+2-6Lines changed: 2 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ type ManagedRole struct {
44
44
// Validation rules ensure immutability of Class, and that Storage and PostgresVersion can only be set once and cannot be removed or downgraded.
45
45
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.postgresVersion) || (has(self.postgresVersion) && int(self.postgresVersion.split('.')[0]) >= int(oldSelf.postgresVersion.split('.')[0]))",messageExpression="!has(self.postgresVersion) ? 'postgresVersion cannot be removed once set (was: ' + oldSelf.postgresVersion + ')' : 'postgresVersion major version cannot be downgraded (from: ' + oldSelf.postgresVersion + ', to: ' + self.postgresVersion + ')'"
46
46
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.storage) || (has(self.storage) && quantity(self.storage).compareTo(quantity(oldSelf.storage)) >= 0)",messageExpression="!has(self.storage) ? 'storage cannot be removed once set (was: ' + string(oldSelf.storage) + ')' : 'storage size cannot be decreased (from: ' + string(oldSelf.storage) + ', to: ' + string(self.storage) + ')'"
47
-
// +kubebuilder:validation:XValidation:rule="!has(self.connectionPoolerConfig)",message="connectionPoolerConfig cannot be overridden on PostgresCluster"
47
+
48
48
typePostgresClusterSpecstruct {
49
49
// This field is IMMUTABLE after creation.
50
50
// +kubebuilder:validation:Required
@@ -92,14 +92,9 @@ type PostgresClusterSpec struct {
92
92
93
93
// ConnectionPoolerEnabled controls whether PgBouncer connection pooling is deployed for this cluster.
94
94
// When set, takes precedence over the class-level connectionPoolerEnabled value.
// PostgresCluster is the Schema for the postgresclusters API.
183
+
// +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 50",message="name must be 50 characters or fewer to accommodate derived resource names"
Copy file name to clipboardExpand all lines: api/v4/postgresclusterclass_types.go
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -24,8 +24,10 @@ import (
24
24
25
25
// +kubebuilder:validation:XValidation:rule="!has(self.cnpg) || self.provisioner == 'postgresql.cnpg.io'",message="cnpg config can only be set when provisioner is postgresql.cnpg.io"
26
26
// +kubebuilder:validation:XValidation:rule="!has(self.config) || !has(self.config.connectionPoolerEnabled) || !self.config.connectionPoolerEnabled || (has(self.cnpg) && has(self.cnpg.connectionPooler))",message="cnpg.connectionPooler must be set when config.connectionPoolerEnabled is true"
27
+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="PostgresClusterClass is immutable after creation"
27
28
// PostgresClusterClassSpec defines the desired state of PostgresClusterClass.
28
29
// PostgresClusterClass is immutable after creation - it serves as a template for Cluster CRs.
30
+
29
31
typePostgresClusterClassSpecstruct {
30
32
// Provisioner identifies which database provisioner to use.
31
33
// Currently supported: "postgresql.cnpg.io" (CloudNativePG)
@@ -174,9 +176,9 @@ type PostgresClusterClassStatus struct {
// PostgresDatabase is the Schema for the postgresdatabases API.
80
+
// +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 50",message="name must be 50 characters or fewer to accommodate derived resource names"
0 commit comments