mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 21:09:30 +02:00
Only schedule switchover for pod migration, consider mainWindow for PGVERSION env change
This commit is contained in:
+5
-5
@@ -97,6 +97,11 @@ func (c *Cluster) Sync(newSpec *acidv1.Postgresql) error {
|
||||
}
|
||||
}
|
||||
|
||||
if !isInMaintenanceWindow(newSpec.Spec.MaintenanceWindows) {
|
||||
// do not apply any major version related changes yet
|
||||
newSpec.Spec.PostgresqlParam.PgVersion = oldSpec.Spec.PostgresqlParam.PgVersion
|
||||
}
|
||||
|
||||
if err = c.syncStatefulSet(); err != nil {
|
||||
if !k8sutil.ResourceAlreadyExists(err) {
|
||||
err = fmt.Errorf("could not sync statefulsets: %v", err)
|
||||
@@ -658,11 +663,6 @@ func (c *Cluster) syncStatefulSet() error {
|
||||
isSafeToRecreatePods = false
|
||||
}
|
||||
|
||||
if !isInMaintenanceWindow(c.Spec.MaintenanceWindows) {
|
||||
postponeReasons = append(postponeReasons, "not in maintenance window")
|
||||
isSafeToRecreatePods = false
|
||||
}
|
||||
|
||||
// if we get here we also need to re-create the pods (either leftovers from the old
|
||||
// statefulset or those that got their configuration from the outdated statefulset)
|
||||
if len(podsToRecreate) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user