Fix volume sync order. (#1340)

This commit is contained in:
Jan Mussler 2021-02-12 17:36:11 +01:00 committed by GitHub
parent c1c0d5faa1
commit 772f0ca771
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -53,6 +53,11 @@ func (c *Cluster) Sync(newSpec *acidv1.Postgresql) error {
return err
}
// sync volume may already transition volumes to gp3, if iops/throughput or type is specified
if err = c.syncVolumes(); err != nil {
return err
}
if c.OpConfig.EnableEBSGp3Migration {
err = c.executeEBSMigration()
if nil != err {
@ -60,10 +65,6 @@ func (c *Cluster) Sync(newSpec *acidv1.Postgresql) error {
}
}
if err = c.syncVolumes(); err != nil {
return err
}
if err = c.enforceMinResourceLimits(&c.Spec); err != nil {
err = fmt.Errorf("could not enforce minimum resource limits: %v", err)
return err