be more permissive with standbys

This commit is contained in:
Felix Kunde
2020-02-24 12:52:05 +01:00
parent 7b94060d17
commit 236fbbf2c6
4 changed files with 82 additions and 30 deletions
+6 -4
View File
@@ -1048,11 +1048,13 @@ func (c *Cluster) getNumberOfInstances(spec *acidv1.PostgresSpec) int32 {
cur := spec.NumberOfInstances
newcur := cur
/* Limit the max number of pods to one, if this is standby-cluster */
if spec.StandbyCluster != nil {
c.logger.Info("Standby cluster can have maximum of 1 pod")
min = 1
max = 1
if newcur > 1 {
c.logger.Warningf("operator only supports standby clusters with 1 pod")
} else {
min = newcur
max = newcur
}
}
if max >= 0 && newcur > max {
newcur = max