Skip to content

Commit 8483d1b

Browse files
K8SPSMDB-872: don't restore a backup with error state (#1266)
https://jira.percona.com/browse/K8SPSMDB-872 Co-authored-by: Inel Pandzic <[email protected]>
1 parent 5e071b9 commit 8483d1b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/controller/perconaservermongodbrestore/perconaservermongodbrestore_controller.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,12 @@ func (r *ReconcilePerconaServerMongoDBRestore) Reconcile(ctx context.Context, re
146146
return rr, errors.Wrap(err, "get backup")
147147
}
148148

149-
if bcp.Status.State != psmdbv1.BackupStateReady {
149+
switch bcp.Status.State {
150+
case psmdbv1.BackupStateError:
151+
err = errors.New("backup is in error state")
152+
return rr, nil
153+
case psmdbv1.BackupStateReady:
154+
default:
150155
return reconcile.Result{}, errors.New("backup is not ready")
151156
}
152157

0 commit comments

Comments
 (0)