We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e95e8f6 + 25e643d commit 5fea56dCopy full SHA for 5fea56d
1 file changed
pkg/cluster/sync.go
@@ -318,9 +318,11 @@ func (c *Cluster) Sync(newSpec *cpov1.Postgresql) error {
318
// If we are requested to replace database contents with a restore only do so after we have everything
319
// properly set up, but before we try to run the upgrade.
320
restoreId := newSpec.Spec.GetBackup().GetRestoreID()
321
- if c.restoreInProgress() || c.Status.RestoreID != restoreId {
322
- if err := c.processRestore(newSpec); err != nil {
323
- return fmt.Errorf("restoring backup failed: %v", err)
+ if restoreId != "" && newSpec.Status.RestoreID != restoreId {
+ if c.restoreInProgress() || c.Status.RestoreID != restoreId {
+ if err := c.processRestore(newSpec); err != nil {
324
+ return fmt.Errorf("restoring backup failed: %v", err)
325
+ }
326
}
327
328
0 commit comments