mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-09 04:36:05 +02:00
Corrections
- set the type of the new configuration parameter to be array of strings - propagate the annotations to statefulset at sync
This commit is contained in:
@@ -1150,18 +1150,6 @@ func (c *Cluster) generateStatefulSet(spec *acidv1.PostgresSpec) (*appsv1.Statef
|
||||
|
||||
annotations = make(map[string]string)
|
||||
|
||||
ToPropagateAnnotations := c.OpConfig.StatefulsetPropAnnotations
|
||||
if ToPropagateAnnotations != nil {
|
||||
PgCRDAnnotations := c.Postgresql.ObjectMeta.GetAnnotations()
|
||||
for _, anno := range ToPropagateAnnotations {
|
||||
for k, v := range PgCRDAnnotations {
|
||||
if k == anno {
|
||||
annotations[k] = v
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
statefulSet := &appsv1.StatefulSet{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: c.statefulSetName(),
|
||||
@@ -1545,7 +1533,6 @@ func (c *Cluster) generateService(role PostgresRole, spec *acidv1.PostgresSpec)
|
||||
},
|
||||
Spec: serviceSpec,
|
||||
}
|
||||
c.logger.Warningln("Rafia get service annotations", service.GetObjectMeta)
|
||||
|
||||
return service
|
||||
}
|
||||
|
||||
@@ -330,6 +330,20 @@ func (c *Cluster) syncStatefulSet() error {
|
||||
}
|
||||
}
|
||||
}
|
||||
ToPropagateAnnotations := c.OpConfig.StatefulsetPropAnnotations
|
||||
PgCRDAnnotations := c.Postgresql.ObjectMeta.GetAnnotations()
|
||||
annotations := make(map[string]string)
|
||||
|
||||
if ToPropagateAnnotations != nil && PgCRDAnnotations != nil {
|
||||
for _, anno := range ToPropagateAnnotations {
|
||||
for k, v := range PgCRDAnnotations {
|
||||
if k == anno {
|
||||
annotations[k] = v
|
||||
}
|
||||
}
|
||||
}
|
||||
c.updateStatefulSetAnnotations(annotations)
|
||||
}
|
||||
}
|
||||
|
||||
// Apply special PostgreSQL parameters that can only be set via the Patroni API.
|
||||
|
||||
Reference in New Issue
Block a user