mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-01 05:37:11 +02:00
Deprecate old LB options, fix endpoint sync. (#287)
* Depreate old LB options, fix endpoint sync. - deprecate useLoadBalancer, replicaLoadBalancer from the manifest and enable_load_balancer from the operator configuration. The old operator configuration options become no-op with this commit. For the old manifest options, `useLoadBalancer` and `replicaLoadBalancer` are still consulted, but only in the absense of the new ones (enableMasterLoadBalancer and enableReplicaLoadBalancer). - Make sure the endpoint being created during the sync receives proper addresses subset. This is more critical for the replicas, as for the masters Patroni will normally re-create the endpoint before the operator. - Avoid creating the replica endpoint, since it will be created automatically by the corresponding service. - Update the README and unit tests. Code review by @mgomezch and @zerg-junior
This commit is contained in:
@@ -111,6 +111,7 @@ func (c *Controller) initOperatorConfig() {
|
||||
}
|
||||
|
||||
c.opConfig = config.NewFromMap(configMapData)
|
||||
c.warnOnDeprecatedOperatorParameters()
|
||||
|
||||
scalyrAPIKey := os.Getenv("SCALYR_API_KEY")
|
||||
if scalyrAPIKey != "" {
|
||||
@@ -119,6 +120,14 @@ func (c *Controller) initOperatorConfig() {
|
||||
|
||||
}
|
||||
|
||||
// warningOnDeprecatedParameters emits warnings upon finding deprecated parmaters
|
||||
func (c *Controller) warnOnDeprecatedOperatorParameters() {
|
||||
if c.opConfig.EnableLoadBalancer != nil {
|
||||
c.logger.Warningf("Operator configuration parameter 'enable_load_balancer' is deprecated and takes no effect. " +
|
||||
"Consider using the 'enable_master_load_balancer' or 'enable_replica_load_balancer' instead.")
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Controller) initPodServiceAccount() {
|
||||
|
||||
if c.opConfig.PodServiceAccountDefinition == "" {
|
||||
|
||||
Reference in New Issue
Block a user