Skip to content

Commit 5fea56d

Browse files
authored
Merge pull request #131 from cybertec-postgresql/fix_restoreID
fix for restore-id if-check
2 parents e95e8f6 + 25e643d commit 5fea56d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

pkg/cluster/sync.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,11 @@ func (c *Cluster) Sync(newSpec *cpov1.Postgresql) error {
318318
// If we are requested to replace database contents with a restore only do so after we have everything
319319
// properly set up, but before we try to run the upgrade.
320320
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)
321+
if restoreId != "" && newSpec.Status.RestoreID != restoreId {
322+
if c.restoreInProgress() || c.Status.RestoreID != restoreId {
323+
if err := c.processRestore(newSpec); err != nil {
324+
return fmt.Errorf("restoring backup failed: %v", err)
325+
}
324326
}
325327
}
326328

0 commit comments

Comments
 (0)