Enable backward compatibility for enable_load_balancer setting from operator configmap

This commit is contained in:
Sergey Dudoladov
2018-03-19 17:19:50 +01:00
parent 931b48fcbb
commit a8862aeee1
4 changed files with 37 additions and 28 deletions
+5 -2
View File
@@ -696,8 +696,11 @@ func (c *Cluster) shouldCreateLoadBalancerForService(role PostgresRole, spec *sp
return *spec.UseLoadBalancer
}
if spec.EnableMasterLoadBalancer != nil {
return *spec.EnableMasterLoadBalancer
// `enable_load_balancer`` governs LB for a master service
// there is no equivalent operator configmap option for the replica LB
if c.OpConfig.EnableLoadBalancer != nil {
c.logger.Debugf("The operator configmap sets the deprecated `enable_load_balancer` param. Consider using the `enable_master_load_balancer` or `enable_replica_load_balancer` instead.", c.Name)
return *c.OpConfig.EnableLoadBalancer
}
return c.OpConfig.EnableMasterLoadBalancer