mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-07 23:09:40 +02:00
Handle update path and renaming
- handle the update path to update sts and connection pooler deployment. This way no need to wait for sync - rename the parameter to downscaler_annotations - handle other review comments
This commit is contained in:
@@ -711,8 +711,7 @@ func (c *Cluster) Update(oldSpec, newSpec *acidv1.Postgresql) error {
|
||||
updateFailed = true
|
||||
return
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(oldSs, newSs) {
|
||||
if !reflect.DeepEqual(oldSs, newSs) || !reflect.DeepEqual(oldSpec.Annotations, newSpec.Annotations) {
|
||||
c.logger.Debugf("syncing statefulsets")
|
||||
// TODO: avoid generating the StatefulSet object twice by passing it to syncStatefulSet
|
||||
if err := c.syncStatefulSet(); err != nil {
|
||||
|
||||
@@ -34,7 +34,7 @@ var cl = New(
|
||||
SuperUsername: superUserName,
|
||||
ReplicationUsername: replicationUserName,
|
||||
},
|
||||
StatefulsetPropagateAnnotations: []string{"downscaler/*"},
|
||||
DownscalerAnnotations: []string{"downscaler/*"},
|
||||
},
|
||||
},
|
||||
k8sutil.NewMockKubernetesClient(),
|
||||
|
||||
+1
-1
@@ -403,7 +403,7 @@ func (c *Cluster) syncStatefulSet() error {
|
||||
// AnnotationsToPropagate get the annotations to update if required
|
||||
// based on the annotations in postgres CRD
|
||||
func (c *Cluster) AnnotationsToPropagate(annotations map[string]string) map[string]string {
|
||||
toPropagateAnnotations := c.OpConfig.StatefulsetPropagateAnnotations
|
||||
toPropagateAnnotations := c.OpConfig.DownscalerAnnotations
|
||||
pgCRDAnnotations := c.Postgresql.ObjectMeta.GetAnnotations()
|
||||
|
||||
if toPropagateAnnotations != nil && pgCRDAnnotations != nil {
|
||||
|
||||
Reference in New Issue
Block a user