Skip to content

Commit 3bad9aa

Browse files
authored
fix when syncing standby discription (#2513)
1 parent 39f426d commit 3bad9aa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/cluster/cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ func (c *Cluster) Update(oldSpec, newSpec *acidv1.Postgresql) error {
981981
}()
982982

983983
// add or remove standby_cluster section from Patroni config depending on changes in standby section
984-
if reflect.DeepEqual(oldSpec.Spec.StandbyCluster, newSpec.Spec.StandbyCluster) {
984+
if !reflect.DeepEqual(oldSpec.Spec.StandbyCluster, newSpec.Spec.StandbyCluster) {
985985
if err := c.syncStandbyClusterConfiguration(); err != nil {
986986
return fmt.Errorf("could not set StandbyCluster configuration options: %v", err)
987987
}

pkg/cluster/sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (c *Cluster) Sync(newSpec *acidv1.Postgresql) error {
8585
}
8686

8787
// add or remove standby_cluster section from Patroni config depending on changes in standby section
88-
if reflect.DeepEqual(oldSpec.Spec.StandbyCluster, newSpec.Spec.StandbyCluster) {
88+
if !reflect.DeepEqual(oldSpec.Spec.StandbyCluster, newSpec.Spec.StandbyCluster) {
8989
if err := c.syncStandbyClusterConfiguration(); err != nil {
9090
return fmt.Errorf("could not sync StandbyCluster configuration: %v", err)
9191
}

0 commit comments

Comments
 (0)