File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ func (c *Cluster) Sync(newSpec *acidv1.Postgresql) error {
4141 defer c .mu .Unlock ()
4242
4343 oldSpec := c .Postgresql
44+
45+ if ! c .isInMaintenanceWindow (newSpec .Spec .MaintenanceWindows ) {
46+ // do not apply any major version related changes yet
47+ newSpec .Spec .PostgresqlParam .PgVersion = oldSpec .Spec .PostgresqlParam .PgVersion
48+ }
49+
4450 c .setSpec (newSpec )
4551
4652 defer func () {
@@ -97,11 +103,6 @@ func (c *Cluster) Sync(newSpec *acidv1.Postgresql) error {
97103 }
98104 }
99105
100- if ! c .isInMaintenanceWindow (newSpec .Spec .MaintenanceWindows ) {
101- // do not apply any major version related changes yet
102- newSpec .Spec .PostgresqlParam .PgVersion = oldSpec .Spec .PostgresqlParam .PgVersion
103- }
104-
105106 if err = c .syncStatefulSet (); err != nil {
106107 if ! k8sutil .ResourceAlreadyExists (err ) {
107108 err = fmt .Errorf ("could not sync statefulsets: %v" , err )
You can’t perform that action at this time.
0 commit comments