Skip to content
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

Show Us What Didn't Match When Comparing StatefulSet Updates #2770

Open
nategoethel opened this issue Oct 9, 2024 · 0 comments
Open

Show Us What Didn't Match When Comparing StatefulSet Updates #2770

nategoethel opened this issue Oct 9, 2024 · 0 comments

Comments

@nategoethel
Copy link

Please, answer some short questions which should help us to understand your problem / question better?

  • Which image of the operator are you using? v1.9.0
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? EKS
  • Are you running Postgres Operator in production? yes
  • Type of issue? Bug/Feature

Some general remarks when posting a bug report:

  • Please, check the operator, pod (Patroni) and postgresql logs first. When copy-pasting many log lines please do it in a separate GitHub gist together with your Postgres CRD and configuration manifest.
  • If you feel this issue might be more related to the Spilo docker image or Patroni, consider opening issues in the respective repos.

Actual Issue Writeup

The Operator is refusing to update my statefulset because it claims there are new labels being introduced. That line comes from this code:

if (c.Statefulset.Spec.Selector != nil) && (statefulSet.Spec.Selector != nil) {
if !reflect.DeepEqual(c.Statefulset.Spec.Selector.MatchLabels, statefulSet.Spec.Selector.MatchLabels) {
// forbid introducing new labels in the selector on the new statefulset, as it would cripple replacements
// due to the fact that the new statefulset won't be able to pick up old pods with non-matching labels.
if !util.MapContains(c.Statefulset.Spec.Selector.MatchLabels, statefulSet.Spec.Selector.MatchLabels) {
c.logger.Warningf("new statefulset introduces extra labels in the label selector, cannot continue")
return &compareStatefulsetResult{}
}
needsReplace = true
reasons = append(reasons, "new statefulset's selector does not match the current one")
}
}

However, there's nothing here that indicates what, specifically, has changed, so I don't know how to correct the issue. It would be helpful to log what labels are new in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant