inject cluster name label into logical backup pod

This commit is contained in:
Felix Kunde
2019-11-18 13:05:31 +01:00
parent 63d1f3bbe4
commit e3a8a9e5d3
2 changed files with 6 additions and 33 deletions
+6 -2
View File
@@ -493,7 +493,7 @@ func generatePodTemplate(
Spec: podSpec,
}
if kubeIAMRole != "" {
if template.Annotations == nil{
if template.Annotations == nil {
template.Annotations = make(map[string]string)
}
template.Annotations[constants.KubeIAmAnnotation] = kubeIAMRole
@@ -967,7 +967,7 @@ func (c *Cluster) generatePodAnnotations(spec *acidv1.PostgresSpec) map[string]s
annotations[k] = v
}
}
if len(annotations) == 0 {
return nil
}
@@ -1557,6 +1557,10 @@ func (c *Cluster) generateLogicalBackupPodEnvVars() []v1.EnvVar {
Name: "SCOPE",
Value: c.Name,
},
{
Name: "CLUSTER_NAME_LABEL",
Value: c.OpConfig.ClusterNameLabel,
},
{
Name: "POD_NAMESPACE",
ValueFrom: &v1.EnvVarSource{