-
Notifications
You must be signed in to change notification settings - Fork 994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure podAnnotations are removed from pods if reset in the config #2826
base: master
Are you sure you want to change the base?
Conversation
799c015
to
93d718e
Compare
93d718e
to
2c9ceed
Compare
👍 |
} | ||
} | ||
annotationToRemove = strings.TrimSuffix(annotationToRemove, ",") + `}}}` | ||
annotationToRemoveTemplate = strings.TrimSuffix(annotationToRemoveTemplate, ",") + `}}}}}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we not use json marshalling here? This concatenating {{{ + }}} looks a bit "ugly".
@@ -1060,7 +1097,6 @@ func (c *Cluster) syncConnectionPoolerWorker(oldSpec, newSpec *acidv1.Postgresql | |||
if err != nil { | |||
return syncReason, err | |||
} | |||
c.ConnectionPooler[role].Deployment = deployment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we change to update internal deployment only if every sync step works, right? Have to think about consequences it might have
listOptions := metav1.ListOptions{ | ||
LabelSelector: labels.Set(c.connectionPoolerLabels(role, true).MatchLabels).String(), | ||
} | ||
pods, err = c.listPoolerPods(listOptions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ToDo for me: Check if we can go with a version of pods we now fetch before changing annotations? Or do we need to fetch them again for the following steps?
return err | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, another thinking out loud comment: We already introduced patch code for annotations. Could it not be reused?
fix use case when an annotation is removed from the
podAnnotations
setting (should be reflected for the running Pods and Pod templates)