fix when syncing standby discription (#2513)

This commit is contained in:
Felix Kunde 2024-01-12 10:41:17 +01:00 committed by GitHub
parent 39f426d56f
commit 3bad9aaded
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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)
}

View File

@ -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)
}