mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-19 02:12:02 +02:00
spec.env can override clone and standby variables (#2159)
This commit is contained in:
@@ -962,6 +962,11 @@ func (c *Cluster) generateSpiloPodEnvVars(
|
||||
envVars = append(envVars, v1.EnvVar{Name: "KUBERNETES_USE_CONFIGMAPS", Value: "true"})
|
||||
}
|
||||
|
||||
// fetch cluster-specific variables that will override all subsequent global variables
|
||||
if len(spec.Env) > 0 {
|
||||
envVars = appendEnvVars(envVars, spec.Env...)
|
||||
}
|
||||
|
||||
if spec.Clone != nil && spec.Clone.ClusterName != "" {
|
||||
envVars = append(envVars, c.generateCloneEnvironment(spec.Clone)...)
|
||||
}
|
||||
@@ -970,11 +975,6 @@ func (c *Cluster) generateSpiloPodEnvVars(
|
||||
envVars = append(envVars, c.generateStandbyEnvironment(spec.StandbyCluster)...)
|
||||
}
|
||||
|
||||
// fetch cluster-specific variables that will override all subsequent global variables
|
||||
if len(spec.Env) > 0 {
|
||||
envVars = appendEnvVars(envVars, spec.Env...)
|
||||
}
|
||||
|
||||
// fetch variables from custom environment Secret
|
||||
// that will override all subsequent global variables
|
||||
secretEnvVarsList, err := c.getPodEnvironmentSecretVariables()
|
||||
|
||||
Reference in New Issue
Block a user