mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-08 17:41:31 +02:00
fix sync streams and add diffs for annotations and owner references (#2728)
* extend and improve hasSlotsInSync unit test * fix sync streams and add diffs for annotations and owner references * incl. current annotations as desired where we do not fully control them * added one more unit test and fixed sub test names * pass maintenance windows to function and update unit test
This commit is contained in:
@@ -228,6 +228,7 @@ func (c *Cluster) syncPatroniConfigMap(suffix string) error {
|
||||
}
|
||||
annotations := make(map[string]string)
|
||||
maps.Copy(annotations, cm.Annotations)
|
||||
// Patroni can add extra annotations so incl. current annotations in desired annotations
|
||||
desiredAnnotations := c.annotationsSet(cm.Annotations)
|
||||
if changed, _ := c.compareAnnotations(annotations, desiredAnnotations); changed {
|
||||
patchData, err := metaAnnotationsPatch(desiredAnnotations)
|
||||
@@ -272,6 +273,7 @@ func (c *Cluster) syncPatroniEndpoint(suffix string) error {
|
||||
}
|
||||
annotations := make(map[string]string)
|
||||
maps.Copy(annotations, ep.Annotations)
|
||||
// Patroni can add extra annotations so incl. current annotations in desired annotations
|
||||
desiredAnnotations := c.annotationsSet(ep.Annotations)
|
||||
if changed, _ := c.compareAnnotations(annotations, desiredAnnotations); changed {
|
||||
patchData, err := metaAnnotationsPatch(desiredAnnotations)
|
||||
@@ -315,6 +317,7 @@ func (c *Cluster) syncPatroniService() error {
|
||||
}
|
||||
annotations := make(map[string]string)
|
||||
maps.Copy(annotations, svc.Annotations)
|
||||
// Patroni can add extra annotations so incl. current annotations in desired annotations
|
||||
desiredAnnotations := c.annotationsSet(svc.Annotations)
|
||||
if changed, _ := c.compareAnnotations(annotations, desiredAnnotations); changed {
|
||||
patchData, err := metaAnnotationsPatch(desiredAnnotations)
|
||||
|
||||
Reference in New Issue
Block a user