mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-18 03:07:33 +02:00
Add topologySpreadConstraints configuration to pod spec. (#2530)
* Add topologySpreadConstraints configuration to pod spec. * Run update-codegen.sh to add deepcopy for new field to the api. * Reuse configured TopologySpreadConstraints for logical backup. * Remove x-kubernetes-preserve-unknown-fields and XPreserveUnknownFields. * Add topologySpreadConstraint example in the complete manifest. * Add support for helm chart. * Add documentation for topologySpreadConstraint. * Update e2e test to patch topologySpreadConstraints into the postgresqls manifest. * For e2e test, updated the PVC retention policy to remove redundant PVCs. * Fix e2e test, expected PVC count in end-to-end test after config changes.
This commit is contained in:
@@ -504,6 +504,11 @@ func (c *Cluster) compareStatefulSetWith(statefulSet *appsv1.StatefulSet) *compa
|
||||
needsRollUpdate = true
|
||||
reasons = append(reasons, "new statefulset's pod affinity does not match the current one")
|
||||
}
|
||||
if !reflect.DeepEqual(c.Statefulset.Spec.Template.Spec.TopologySpreadConstraints, statefulSet.Spec.Template.Spec.TopologySpreadConstraints) {
|
||||
needsReplace = true
|
||||
needsRollUpdate = true
|
||||
reasons = append(reasons, "new statefulset's pod topologySpreadConstraints does not match the current one")
|
||||
}
|
||||
if len(c.Statefulset.Spec.Template.Spec.Tolerations) != len(statefulSet.Spec.Template.Spec.Tolerations) {
|
||||
needsReplace = true
|
||||
needsRollUpdate = true
|
||||
|
||||
Reference in New Issue
Block a user