Skip to content

Commit 0ac4205

Browse files
committed
FIXUP: reject replica for now
1 parent ac0feee commit 0ac4205

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4718,7 +4718,7 @@ spec:
47184718
- message: domain socket paths cannot be changed
47194719
rule: '!self.exists(k, k.startsWith("unix_socket_"))'
47204720
- message: wal_level must be "replica" or higher
4721-
rule: '!has(self.wal_level) || self.wal_level in ["replica","logical"]'
4721+
rule: '!has(self.wal_level) || self.wal_level in ["logical"]'
47224722
- message: wal_log_hints are always enabled
47234723
rule: '!has(self.wal_log_hints)'
47244724
- rule: '!has(self.archive_mode) && !has(self.archive_command)

internal/testing/validation/postgrescluster_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,6 @@ func TestPostgresConfigParameters(t *testing.T) {
163163
"wal_level": intstr.FromString("logical"),
164164
}
165165
assert.NilError(t, cc.Create(ctx, cluster, client.DryRunAll))
166-
167-
cluster.Spec.Config.Parameters = map[string]intstr.IntOrString{
168-
"wal_level": intstr.FromString("replica"),
169-
}
170-
assert.NilError(t, cc.Create(ctx, cluster, client.DryRunAll))
171166
})
172167

173168
t.Run("Invalid", func(t *testing.T) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type PostgresConfig struct {
4343
// # Write Ahead Log
4444
// - https://www.postgresql.org/docs/current/runtime-config-wal.html
4545
//
46-
// +kubebuilder:validation:XValidation:rule=`!has(self.wal_level) || self.wal_level in ["replica","logical"]`,message=`wal_level must be "replica" or higher`
46+
// +kubebuilder:validation:XValidation:rule=`!has(self.wal_level) || self.wal_level in ["logical"]`,message=`wal_level must be "replica" or higher`
4747
// +kubebuilder:validation:XValidation:rule=`!has(self.wal_log_hints)`,message=`wal_log_hints are always enabled`
4848
// +kubebuilder:validation:XValidation:rule=`!has(self.archive_mode) && !has(self.archive_command) && !has(self.restore_command)`
4949
// +kubebuilder:validation:XValidation:rule=`!has(self.recovery_target) && !self.exists(k, k.startsWith("recovery_target_"))`

0 commit comments

Comments
 (0)