fix when syncing standby discription (#2513)
This commit is contained in:
parent
39f426d56f
commit
3bad9aaded
|
|
@ -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
|
// 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 {
|
if err := c.syncStandbyClusterConfiguration(); err != nil {
|
||||||
return fmt.Errorf("could not set StandbyCluster configuration options: %v", err)
|
return fmt.Errorf("could not set StandbyCluster configuration options: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
// 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 {
|
if err := c.syncStandbyClusterConfiguration(); err != nil {
|
||||||
return fmt.Errorf("could not sync StandbyCluster configuration: %v", err)
|
return fmt.Errorf("could not sync StandbyCluster configuration: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue