From 3bad9aaded6e069c85cf82078feb8beb0230c322 Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Fri, 12 Jan 2024 10:41:17 +0100 Subject: [PATCH] fix when syncing standby discription (#2513) --- pkg/cluster/cluster.go | 2 +- pkg/cluster/sync.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index dca1f2eee..35628badb 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -981,7 +981,7 @@ func (c *Cluster) Update(oldSpec, newSpec *acidv1.Postgresql) error { }() // add or remove standby_cluster section from Patroni config depending on changes in standby section - if reflect.DeepEqual(oldSpec.Spec.StandbyCluster, newSpec.Spec.StandbyCluster) { + if !reflect.DeepEqual(oldSpec.Spec.StandbyCluster, newSpec.Spec.StandbyCluster) { if err := c.syncStandbyClusterConfiguration(); err != nil { return fmt.Errorf("could not set StandbyCluster configuration options: %v", err) } diff --git a/pkg/cluster/sync.go b/pkg/cluster/sync.go index d5f9485c8..e044ac1c1 100644 --- a/pkg/cluster/sync.go +++ b/pkg/cluster/sync.go @@ -85,7 +85,7 @@ func (c *Cluster) Sync(newSpec *acidv1.Postgresql) error { } // add or remove standby_cluster section from Patroni config depending on changes in standby section - if reflect.DeepEqual(oldSpec.Spec.StandbyCluster, newSpec.Spec.StandbyCluster) { + if !reflect.DeepEqual(oldSpec.Spec.StandbyCluster, newSpec.Spec.StandbyCluster) { if err := c.syncStandbyClusterConfiguration(); err != nil { return fmt.Errorf("could not sync StandbyCluster configuration: %v", err) }