spec.env can override clone and standby variables (#2159)

This commit is contained in:
Felix Kunde
2023-01-05 12:02:19 +01:00
committed by GitHub
parent becf8a4715
commit c756cb2f8a
3 changed files with 55 additions and 8 deletions
+5 -5
View File
@@ -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()