File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
scripts/aks-fleet-deployment Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -61,9 +61,12 @@ func (r *DocumentDBReconciler) AddClusterReplicationToClusterSpec(
6161 // If primary and HA we want a local standby and a slot for the WAL replica
6262 // TODO change to 2 when WAL replica is available
6363 cnpgCluster .Spec .Instances = 3
64- cnpgCluster .Spec .Bootstrap .InitDB .PostInitSQL =
65- append (cnpgCluster .Spec .Bootstrap .InitDB .PostInitSQL ,
64+ // Restoring from backup won't have PostInitSQL configured
65+ if cnpgCluster .Spec .Bootstrap != nil && cnpgCluster .Spec .Bootstrap .InitDB != nil && cnpgCluster .Spec .Bootstrap .InitDB .PostInitSQL != nil {
66+ cnpgCluster .Spec .Bootstrap .InitDB .PostInitSQL = append (
67+ cnpgCluster .Spec .Bootstrap .InitDB .PostInitSQL ,
6668 "select * from pg_create_physical_replication_slot('wal_replica');" )
69+ }
6770 // Also need to configure quorum writes
6871 cnpgCluster .Spec .PostgresConfiguration .Synchronous = & cnpgv1.SynchronousReplicaConfiguration {
6972 Method : cnpgv1 .SynchronousReplicaConfigurationMethodAny ,
Original file line number Diff line number Diff line change 3232 version : v1
3333 kind : CustomResourceDefinition
3434 name : imagecatalogs.postgresql.cnpg.io
35+ - group : " apiextensions.k8s.io"
36+ version : v1
37+ kind : CustomResourceDefinition
38+ name : backups.postgresql.cnpg.io
3539 - group : " apiextensions.k8s.io"
3640 version : v1
3741 kind : CustomResourceDefinition
Original file line number Diff line number Diff line change 11apiVersion : db.microsoft.com/preview
2- kind : Backup
2+ kind : ScheduledBackup
33metadata :
44 name : backup-test
55 namespace : documentdb-preview-ns
66spec :
77 cluster :
88 name : documentdb-preview
9+ schedule : " * * * * *"
910
1011---
1112apiVersion : placement.kubernetes-fleet.io/v1beta1
You can’t perform that action at this time.
0 commit comments