mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-07 01:41:21 +02:00
Add patroni_use_kubernetes parameter.
Add a dedicated parameter to enable support for Kubernetes in Patroni instead of relying on a legacy hack of setting etcd_host to an empty string. The latter still works, however, it will show a warning, nudging users to change to the new parameter. For the sake of not breaking existing non-Kubernetes setups, patroni_use_kubernetes has not effect if etcd_host is set to a non-empty value.
This commit is contained in:
@@ -112,6 +112,7 @@ func (c *Controller) initOperatorConfig() {
|
||||
|
||||
c.opConfig = config.NewFromMap(configMapData)
|
||||
c.warnOnDeprecatedOperatorParameters()
|
||||
c.processDeprecatedOperatorParameters()
|
||||
|
||||
scalyrAPIKey := os.Getenv("SCALYR_API_KEY")
|
||||
if scalyrAPIKey != "" {
|
||||
@@ -126,6 +127,20 @@ func (c *Controller) warnOnDeprecatedOperatorParameters() {
|
||||
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.")
|
||||
}
|
||||
if c.opConfig.EtcdHost == "" && !c.opConfig.PatroniUseKubernetes {
|
||||
c.logger.Warningf("Set 'patroni_use_kubernetes' instead of setting 'etcd_host' set to an empty string to enable " +
|
||||
"support for Kubernetes API in Patroni.")
|
||||
}
|
||||
if c.opConfig.EtcdHost != "" && c.opConfig.PatroniUseKubernetes {
|
||||
c.logger.Warningf("both 'patroni_use_kubernetes' is enabled and 'etcd_host' is set to a non-empty value, " +
|
||||
"'patroni_use_kubernetes' is ignored.")
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Controller) processDeprecatedOperatorParameters() {
|
||||
if c.opConfig.EtcdHost == "" && !c.opConfig.PatroniUseKubernetes {
|
||||
c.opConfig.PatroniUseKubernetes = true
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Controller) initPodServiceAccount() {
|
||||
|
||||
Reference in New Issue
Block a user